GeoDiscoverWiki
geodiscoverwikiwiki
https://geodiscoverwiki.miraheze.org/wiki/Main_Page
MediaWiki 1.40.1
first-letter
Media
Special
Talk
User
User talk
GeoDiscoverWiki
GeoDiscoverWiki talk
File
File talk
MediaWiki
MediaWiki talk
Template
Template talk
Help
Help talk
Category
Category talk
Module
Module talk
Template:Infobox military conflict
10
7
19
2023-11-02T18:21:42Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Infobox_military_conflict]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Infobox military conflict|main}}</includeonly><noinclude>{{documentation}}</noinclude>
d340eca466eb5d0a69c1f4ac57d0f34d306ed031
Template:Abbr
10
19
43
2023-11-02T18:21:43Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Abbr]]
wikitext
text/x-wiki
<abbr {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} title="{{#tag:nowiki|{{#invoke:String|replace|{{{2|}}}|"|"}}}}">{{{1|}}}</abbr><noinclude>{{Documentation}}
</noinclude>
5fd53aa19ba927ce3eea9092a4fa31f881df0a6e
Module:Arguments
828
21
47
2023-11-02T18:21:43Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Arguments]]
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Yesno
828
50
105
2023-11-02T18:21:43Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Yesno]]
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Template:Tl
10
57
119
2023-11-02T18:21:43Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Tl]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
{{Redirect category shell|
{{R from move}}
}}
d6593bb3b4a866249f55d0f34b047a71fe1f1529
Template:Yesno
10
14
33
2023-11-02T18:21:44Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Yesno]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|ยฌ}}} }}
|no
|n
|f
|false
|off
|0 = {{{no|<!-- null -->}}}
| = {{{blank|{{{no|<!-- null -->}}}}}}
|ยฌ = {{{ยฌ|}}}
|yes
|y
|t
|true
|on
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
629c2937bc5cf7cfe13cd2a598582af832782399
Module:Message box
828
51
107
2023-11-02T18:21:44Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Message_box]]
Scribunto
text/plain
require('strict')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
self.typeImageNeedsLink = typeData.imageNeedsLink
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s%s|alt=]]', self.typeImage
or 'Information icon4.svg', imageSize, self.typeImageNeedsLink and "" or "|link=" )
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
f2fb84f7b817d2d88747f57c40902a0d8be8158a
Module:Message box/configuration
828
52
109
2023-11-02T18:21:44Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Message_box/configuration]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '<small>[[Help:Maintenance template removal|Learn how and when to remove this template message]]</small>',
templatestyles = 'Module:Message box/ambox.css'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true,
templatestyles = 'Module:Message box/cmbox.css'
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false,
templatestyles = 'Module:Message box/fmbox.css'
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox-license.svg'
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg',
imageNeedsLink = true
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes',
templatestyles = 'Module:Message box/imbox.css'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true,
templatestyles = 'Module:Message box/ombox.css'
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
templateCategory = 'Talk message boxes',
templatestyles = 'Module:Message box/tmbox.css'
}
}
27f00af5cf3939613e9156acd5e62a3469d03d81
Template:Template link
10
58
121
2023-11-02T18:21:44Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Template_link]]
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eabbec62efe3044a98ebb3ce9e7d4d43c222351d
Template:Main other
10
16
37
2023-11-02T18:21:45Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Main_other]]
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
</noinclude>
86ad907ffeea3cc545159e00cd1f2d6433946450
Template:Hlist
10
54
113
2023-11-02T18:21:45Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Hlist]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|horizontal}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
9e3824c2e3c0e0dbef2f37556ac0b994987fecf9
Template:Flatlist
10
104
213
2023-11-02T18:21:45Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Flatlist]]
wikitext
text/x-wiki
<templatestyles src="Hlist/styles.css"/><div class="hlist {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
{{{1}}}
</div>}}<noinclude></div>
{{documentation}}
</noinclude>
cf60aa4aef920d48fa394e786f72fe5f6dcd3169
Module:String
828
9
23
2023-11-02T18:21:46Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:String]]
Scribunto
text/plain
--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters,
unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
automatically remove any leading or trailing whitespace from the parameter.
Depending on the intended use, it may be advantageous to either preserve or
remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in
an empty string being returned rather than an error message.
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String].
no_category: If set to 'true' or 1, no category will be added if an error
is generated.
Unit tests for this module are available at Module:String/tests.
]]
local str = {}
--[[
len
This function returns the length of the target string.
Usage:
{{#invoke:String|len|target_string|}}
OR
{{#invoke:String|len|s=target_string}}
Parameters
s: The string whose length to report
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string.
]]
function str.len( frame )
local new_args = str._getParameters( frame.args, {'s'} )
local s = new_args['s'] or ''
return mw.ustring.len( s )
end
--[[
sub
This function returns a substring of the target string at specified indices.
Usage:
{{#invoke:String|sub|target_string|start_index|end_index}}
OR
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
Parameters
s: The string to return a subset of
i: The first index of the substring to return, defaults to 1.
j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j
is a negative value, it is interpreted the same as selecting a character by
counting from the end of the string. Hence, a value of -1 is the same as
selecting the last character of the string.
If the requested indices are out of range for the given string, an error is
reported.
]]
function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } )
local s = new_args['s'] or ''
local i = tonumber( new_args['i'] ) or 1
local j = tonumber( new_args['j'] ) or -1
local len = mw.ustring.len( s )
-- Convert negatives for range checking
if i < 0 then
i = len + i + 1
end
if j < 0 then
j = len + j + 1
end
if i > len or j > len or i < 1 or j < 1 then
return str._error( 'String subset index out of range' )
end
if j < i then
return str._error( 'String subset indices out of order' )
end
return mw.ustring.sub( s, i, j )
end
--[[
This function implements that features of {{str sub old}} and is kept in order
to maintain these older templates.
]]
function str.sublength( frame )
local i = tonumber( frame.args.i ) or 0
local len = tonumber( frame.args.len )
return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
end
--[[
_match
This function returns a substring from the source string that matches a
specified pattern. It is exported for use in other modules
Usage:
strmatch = require("Module:String")._match
sresult = strmatch( s, pattern, start, match, plain, nomatch )
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This sub-routine is exported for use in other modules
function str._match( s, pattern, start, match_index, plain_flag, nomatch )
if s == '' then
return str._error( 'Target string is empty' )
end
if pattern == '' then
return str._error( 'Pattern string is empty' )
end
start = tonumber(start) or 1
if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
return str._error( 'Requested start is out of range' )
end
if match_index == 0 then
return str._error( 'Match index is out of range' )
end
if plain_flag then
pattern = str._escapePattern( pattern )
end
local result
if match_index == 1 then
-- Find first match is simple case
result = mw.ustring.match( s, pattern, start )
else
if start > 1 then
s = mw.ustring.sub( s, start )
end
local iterator = mw.ustring.gmatch(s, pattern)
if match_index > 0 then
-- Forward search
for w in iterator do
match_index = match_index - 1
if match_index == 0 then
result = w
break
end
end
else
-- Reverse search
local result_table = {}
local count = 1
for w in iterator do
result_table[count] = w
count = count + 1
end
result = result_table[ count + match_index ]
end
end
if result == nil then
if nomatch == nil then
return str._error( 'Match not found' )
else
return nomatch
end
else
return result
end
end
--[[
match
This function returns a substring from the source string that matches a
specified pattern.
Usage:
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
OR
{{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index
|match=match_number|plain=plain_flag|nomatch=nomatch_output}}
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from each string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then
this function generates an error. An error is also generated if no match is found.
If one adds the parameter ignore_errors=true, then the error will be suppressed and
an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This is the entry point for #invoke:String|match
function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} )
local s = new_args['s'] or ''
local start = tonumber( new_args['start'] ) or 1
local plain_flag = str._getBoolean( new_args['plain'] or false )
local pattern = new_args['pattern'] or ''
local match_index = math.floor( tonumber(new_args['match']) or 1 )
local nomatch = new_args['nomatch']
return str._match( s, pattern, start, match_index, plain_flag, nomatch )
end
--[[
pos
This function returns a single character from the target string at position pos.
Usage:
{{#invoke:String|pos|target_string|index_value}}
OR
{{#invoke:String|pos|target=target_string|pos=index_value}}
Parameters
target: The string to search
pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards
from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error.
]]
function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} )
local target_str = new_args['target'] or ''
local pos = tonumber( new_args['pos'] ) or 0
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
return str._error( 'String index out of range' )
end
return mw.ustring.sub( target_str, pos, pos )
end
--[[
str_find
This function duplicates the behavior of {{str_find}}, including all of its quirks.
This is provided in order to support existing templates, but is NOT RECOMMENDED for
new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based,
and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a
value of "1", which is generally unexpected behavior, and must be accounted for
separatetly.
]]
function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} )
local source_str = new_args['source'] or ''
local target_str = new_args['target'] or ''
if target_str == '' then
return 1
end
local start = mw.ustring.find( source_str, target_str, 1, true )
if start == nil then
start = -1
end
return start
end
--[[
find
This function allows one to search for a target string or pattern within another
string.
Usage:
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
OR
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
Parameters
source: The string to search
target: The string or pattern to find within source
start: The index within the source string to start the search, defaults to 1
plain: Boolean flag indicating that target should be understood as plain
text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the parameter. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found
within "source". Indices are 1-based. If "target" is not found, then this
function returns 0. If either "source" or "target" are missing / empty, this
function also returns 0.
This function should be safe for UTF-8 strings.
]]
function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['target'] or ''
local start_pos = tonumber(new_args['start']) or 1
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return 0
end
plain = str._getBoolean( plain )
local start = mw.ustring.find( source_str, pattern, start_pos, plain )
if start == nil then
start = 0
end
return start
end
--[[
replace
This function allows one to replace a target string or pattern within another
string.
Usage:
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
OR
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
count=replacement_count|plain=plain_flag}}
Parameters
source: The string to search
pattern: The string or pattern to find within source
replace: The replacement text
count: The number of occurences to replace, defaults to all.
plain: Boolean flag indicating that pattern should be understood as plain
text and not as a Lua style regular expression, defaults to true
]]
function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['pattern'] or ''
local replace = new_args['replace'] or ''
local count = tonumber( new_args['count'] )
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return source_str
end
plain = str._getBoolean( plain )
if plain then
pattern = str._escapePattern( pattern )
replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences.
end
local result
if count ~= nil then
result = mw.ustring.gsub( source_str, pattern, replace, count )
else
result = mw.ustring.gsub( source_str, pattern, replace )
end
return result
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] )
if not repetitions then
return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
return string.rep( frame.args[1] or '', repetitions )
end
--[[
escapePattern
This function escapes special characters from a Lua string pattern. See [1]
for details on how patterns work.
[1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
Usage:
{{#invoke:String|escapePattern|pattern_string}}
Parameters
pattern_string: The pattern string to escape.
]]
function str.escapePattern( frame )
local pattern_str = frame.args[1]
if not pattern_str then
return str._error( 'No pattern string specified' )
end
local result = str._escapePattern( pattern_str )
return result
end
--[[
count
This function counts the number of occurrences of one string in another.
]]
function str.count(frame)
local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'})
local source = args.source or ''
local pattern = args.pattern or ''
local plain = str._getBoolean(args.plain or true)
if plain then
pattern = str._escapePattern(pattern)
end
local _, count = mw.ustring.gsub(source, pattern, '')
return count
end
--[[
endswith
This function determines whether a string ends with another string.
]]
function str.endswith(frame)
local args = str._getParameters(frame.args, {'source', 'pattern'})
local source = args.source or ''
local pattern = args.pattern or ''
if pattern == '' then
-- All strings end with the empty string.
return "yes"
end
if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then
return "yes"
else
return ""
end
end
--[[
join
Join all non empty arguments together; the first argument is the separator.
Usage:
{{#invoke:String|join|sep|one|two|three}}
]]
function str.join(frame)
local args = {}
local sep
for _, v in ipairs( frame.args ) do
if sep then
if v ~= '' then
table.insert(args, v)
end
else
sep = v
end
end
return table.concat( args, sep or '' )
end
--[[
Helper function that populates the argument list given that user may need to use a mix of
named and unnamed parameters. This is relevant because named parameters are not
identical to unnamed parameters due to string trimming, and when dealing with strings
we sometimes want to either preserve or remove that whitespace depending on the application.
]]
function str._getParameters( frame_args, arg_list )
local new_args = {}
local index = 1
local value
for _, arg in ipairs( arg_list ) do
value = frame_args[arg]
if value == nil then
value = frame_args[index]
index = index + 1
end
new_args[arg] = value
end
return new_args
end
--[[
Helper function to handle error messages.
]]
function str._error( error_str )
local frame = mw.getCurrentFrame()
local error_category = frame.args.error_category or 'Errors reported by Module String'
local ignore_errors = frame.args.ignore_errors or false
local no_category = frame.args.no_category or false
if str._getBoolean(ignore_errors) then
return ''
end
local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>'
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str
end
return error_str
end
--[[
Helper Function to interpret boolean strings
]]
function str._getBoolean( boolean_str )
local boolean_value
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower()
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
or boolean_str == '' then
boolean_value = false
else
boolean_value = true
end
elseif type( boolean_str ) == 'boolean' then
boolean_value = boolean_str
else
error( 'No boolean value found' )
end
return boolean_value
end
--[[
Helper function that escapes all pattern characters so that they will be treated
as plain text.
]]
function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" )
end
return str
2ad0905c56ef4955950b75a8f00974fe82aed5e4
Module:Infobox
828
12
29
2023-11-02T18:21:46Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Infobox]]
Scribunto
text/plain
local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local lists = {
plainlist_t = {
patterns = {
'^plainlist$',
'%splainlist$',
'^plainlist%s',
'%splainlist%s'
},
found = false,
styles = 'Plainlist/styles.css'
},
hlist_t = {
patterns = {
'^hlist$',
'%shlist$',
'^hlist%s',
'%shlist%s'
},
found = false,
styles = 'Hlist/styles.css'
}
}
local function has_list_class(args_to_check)
for _, list in pairs(lists) do
if not list.found then
for _, arg in pairs(args_to_check) do
for _, pattern in ipairs(list.patterns) do
if mw.ustring.find(arg or '', pattern) then
list.found = true
break
end
end
if list.found then break end
end
end
end
end
local function fixChildBoxes(sval, tt)
local function notempty( s ) return s and s:match( '%S' ) end
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- [[Special:Diff/849054481]]
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
-- Cleans empty tables
local function cleanInfobox()
root = tostring(root)
if has_rows == false then
root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
end
end
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class, args.headerclass })
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:tag('th')
:attr('colspan', '2')
:addClass('infobox-header')
:addClass(rowArgs.class)
:addClass(args.headerclass)
-- @deprecated next; target .infobox-<name> .infobox-header
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
if rowArgs.data then
root:wikitext(
'[[Category:Pages using infobox templates with ignored data cells]]'
)
end
elseif rowArgs.data and rowArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class })
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
-- @deprecated next; target .infobox-<name> .infobox-label
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
dataCell
:attr('colspan', not rowArgs.label and '2' or nil)
:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox(-full)-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
else
table.insert(empty_row_categories, rowArgs.data or '')
end
end
local function renderTitle()
if not args.title then return end
has_rows = true
has_list_class({args.titleclass})
root
:tag('caption')
:addClass('infobox-title')
:addClass(args.titleclass)
-- @deprecated next; target .infobox-<name> .infobox-title
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
has_rows = true
has_list_class({ args.aboveclass })
root
:tag('tr')
:tag('th')
:attr('colspan', '2')
:addClass('infobox-above')
:addClass(args.aboveclass)
-- @deprecated next; target .infobox-<name> .infobox-above
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
has_rows = true
has_list_class({ args.belowclass })
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-below')
:addClass(args.belowclass)
-- @deprecated next; target .infobox-<name> .infobox-below
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function addSubheaderRow(subheaderArgs)
if subheaderArgs.data and
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ subheaderArgs.rowclass, subheaderArgs.class })
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-subheader')
:addClass(subheaderArgs.class)
:cssText(subheaderArgs.datastyle)
:cssText(subheaderArgs.rowcellstyle)
:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
else
table.insert(empty_row_categories, subheaderArgs.data or '')
end
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addSubheaderRow({
data = args['subheader' .. tostring(num)],
-- @deprecated next; target .infobox-<name> .infobox-subheader
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function addImageRow(imageArgs)
if imageArgs.data and
imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ imageArgs.rowclass, imageArgs.class })
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-image')
:addClass(imageArgs.class)
:cssText(imageArgs.datastyle)
:wikitext(fixChildBoxes(imageArgs.data, 'td'))
else
table.insert(empty_row_categories, imageArgs.data or '')
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:addClass('infobox-caption')
-- @deprecated next; target .infobox-<name> .infobox-caption
:cssText(args.captionstyle)
:wikitext(caption)
end
addImageRow({
data = tostring(data),
-- @deprecated next; target .infobox-<name> .infobox-image
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
if not args.autoheaders then return end
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local lastheader
for k, num in ipairs(rownums) do
if args['header' .. tostring(num)] then
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
lastheader = num
elseif args['data' .. tostring(num)] and
args['data' .. tostring(num)]:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
local data = args['data' .. tostring(num)]
if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
lastheader = nil
end
end
end
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
end
-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
-- @deprecated next; target .infobox-<name> rowclass
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-navbar')
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(require('Module:Italic title')._main({}))
end
end
-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
for _, s in ipairs(empty_row_categories) do
root:wikitext(s)
end
end
-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
if args.decat == 'yes' then return end
if args.child == 'yes' then
if args.title then
root:wikitext(
'[[Category:Pages using embedded infobox templates with the title parameter]]'
)
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles using infobox templates with no data rows]]')
end
end
--[=[
Loads the templatestyles for the infobox.
TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
local hlist_templatestyles = ''
if lists.hlist_t.found then
hlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.hlist_t.styles }
}
end
local plainlist_templatestyles = ''
if lists.plainlist_t.found then
plainlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.plainlist_t.styles }
}
end
-- See function description
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
}
local templatestyles = ''
if args['templatestyles'] then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
-- hlist -> plainlist -> base is best-effort to preserve old Common.css ordering.
-- this ordering is not a guarantee because the rows of interest invoking
-- each class may not be on a specific page
hlist_templatestyles,
plainlist_templatestyles,
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()
renderImages()
preprocessRows()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderEmptyRowCategories()
renderTrackingCategories()
cleanInfobox()
end
-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
:addClass(args.bodyclass)
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
has_list_class({ args.bodyclass })
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
structure_infobox_common()
return loadTemplateStyles() .. root
end
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or
(v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present
-- and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
-- Do another loop if any arguments are found, even blank ones.
moreArgumentsExist = true
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present
-- and not blank, or we are processing "prefix1" and "prefix" is
-- present and not blank, and if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()
preprocessSingleArg('autoheaders')
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
-- different behaviour for italics if blank or absent
args['italic title'] = origArgs['italic title']
preprocessSingleArg('decat')
preprocessSingleArg('templatestyles')
preprocessSingleArg('child templatestyles')
preprocessSingleArg('grandchild templatestyles')
end
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
origArgs = {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
return p
0ddb7e5c8426d67cd589b710efb9912ddfb67fea
Module:Check for unknown parameters
828
15
35
2023-11-02T18:21:46Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Check_for_unknown_parameters]]
Scribunto
text/plain
-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
local function clean(text)
-- Return text cleaned for display and truncated if too long.
-- Strip markers are replaced with dummy text representing the original wikitext.
local pos, truncated
local function truncate(text)
if truncated then
return ''
end
if mw.ustring.len(text) > 25 then
truncated = true
text = mw.ustring.sub(text, 1, 25) .. '...'
end
return mw.text.nowiki(text)
end
local parts = {}
for before, tag, remainder in text:gmatch('([^\127]*)\127[^\127]*%-(%l+)%-[^\127]*\127()') do
pos = remainder
table.insert(parts, truncate(before) .. '<' .. tag .. '>...</' .. tag .. '>')
end
table.insert(parts, truncate(text:sub(pos or 1)))
return table.concat(parts)
end
function p._check(args, pargs)
if type(args) ~= "table" or type(pargs) ~= "table" then
-- TODO: error handling
return
end
-- create the list of known args, regular expressions, and the return string
local knownargs = {}
local regexps = {}
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
-- loop over the parent args, and make sure they are on the list
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local values = {}
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
table.insert(values, clean(k))
end
elseif type(k) == 'number' and knownargs[tostring(k)] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(tostring(k), regexp) then
knownflag = true
break
end
end
if not knownflag and ( showblankpos or isnotempty(v) ) then
table.insert(values, k .. ' = ' .. clean(v))
end
end
end
-- add results to the output tables
local res = {}
if #values > 0 then
local unknown_text = args['unknown'] or 'Found _VALUE_, '
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
local preview_text = args['preview']
if isnotempty(preview_text) then
preview_text = require('Module:If preview')._warning({preview_text})
elseif preview == nil then
preview_text = unknown_text
end
unknown_text = preview_text
end
for _, v in pairs(values) do
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
if v == '' then v = ' ' end
-- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
end
end
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
return p
93db6d115d4328d2a5148bb42959105e367b663e
Template:Br separated entries
10
27
59
2023-11-02T18:21:46Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Br_separated_entries]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|br}}<noinclude>
{{documentation}}
</noinclude>
2019f7fc383259e70d66e43cbd97a43d20889f1b
Module:List
828
10
25
2023-11-02T18:21:47Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:List]]
Scribunto
text/plain
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes and TemplateStyles
data.classes = {}
data.templatestyles = ''
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Plainlist/styles.css' }
}
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for _, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for _, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for _, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return data.templatestyles .. tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
7a4f36a6e9cd56370bdd8207d23694124821dc1a
Module:TableTools
828
33
71
2023-11-02T18:21:47Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:TableTools]]
Scribunto
text/plain
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should not --
-- be called directly from #invoke. --
------------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
function p.isPositiveInteger(v)
return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false if
-- not. Although it doesn't operate on tables, it is included here as it is useful
-- for determining whether a value can be a valid table key. Lua will generate an
-- error if a NaN is used as a table key.
------------------------------------------------------------------------------------
function p.isNan(v)
return type(v) == 'number' and v ~= v
end
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
function p.shallowClone(t)
checkType('shallowClone', 1, t, 'table')
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
function p.removeDuplicates(arr)
checkType('removeDuplicates', 1, arr, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for _, v in ipairs(arr) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will return
-- {1, 3, 6}.
------------------------------------------------------------------------------------
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like {"foo1", "bar1", "foo2", "baz2"}, returns a table
-- of subtables in the format
-- {[1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'}}.
-- Keys that don't end with an integer are stored in a subtable named "other". The
-- compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for _ in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
elseif type1 == 'table' or type1 == 'boolean' or type1 == 'function' then
return tostring(item1) < tostring(item2)
else
return item1 < item2
end
end
------------------------------------------------------------------------------------
-- keysToList
--
-- Returns an array of the keys in a table, sorted using either a default
-- comparison function or a custom keySort function.
------------------------------------------------------------------------------------
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, {'function', 'boolean', 'nil'})
end
local arr = {}
local index = 1
for k in pairs(t) do
arr[index] = k
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(arr, keySort)
end
return arr
end
------------------------------------------------------------------------------------
-- sortedPairs
--
-- Iterates through a table, with the keys sorted using the keysToList function.
-- If there are only numerical keys, sparseIpairs is probably more efficient.
------------------------------------------------------------------------------------
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local arr = p.keysToList(t, keySort, true)
local i = 0
return function ()
i = i + 1
local key = arr[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- isArray
--
-- Returns true if the given value is a table and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArray(v)
if type(v) ~= 'table' then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- isArrayLike
--
-- Returns true if the given value is iterable and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArrayLike(v)
if not pcall(pairs, v) then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- invert
--
-- Transposes the keys and values in an array. For example, {"a", "b", "c"} ->
-- {a = 1, b = 2, c = 3}. Duplicates are not supported (result values refer to
-- the index of the last duplicate) and NaN values are ignored.
------------------------------------------------------------------------------------
function p.invert(arr)
checkType("invert", 1, arr, "table")
local isNan = p.isNan
local map = {}
for i, v in ipairs(arr) do
if not isNan(v) then
map[v] = i
end
end
return map
end
------------------------------------------------------------------------------------
-- listToSet
--
-- Creates a set from the array part of the table. Indexing the set by any of the
-- values of the array returns true. For example, {"a", "b", "c"} ->
-- {a = true, b = true, c = true}. NaN values are ignored as Lua considers them
-- never equal to any value (including other NaNs or even themselves).
------------------------------------------------------------------------------------
function p.listToSet(arr)
checkType("listToSet", 1, arr, "table")
local isNan = p.isNan
local set = {}
for _, v in ipairs(arr) do
if not isNan(v) then
set[v] = true
end
end
return set
end
------------------------------------------------------------------------------------
-- deepCopy
--
-- Recursive deep copy function. Preserves identities of subtables.
------------------------------------------------------------------------------------
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[_deepCopy(orig_key, includeMetatable, already_seen)] = _deepCopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = _deepCopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
------------------------------------------------------------------------------------
-- sparseConcat
--
-- Concatenates all values in the table that are indexed by a number, in order.
-- sparseConcat{a, nil, c, d} => "acd"
-- sparseConcat{nil, b, c, d} => "bcd"
------------------------------------------------------------------------------------
function p.sparseConcat(t, sep, i, j)
local arr = {}
local arr_i = 0
for _, v in p.sparseIpairs(t) do
arr_i = arr_i + 1
arr[arr_i] = v
end
return table.concat(arr, sep, i, j)
end
------------------------------------------------------------------------------------
-- length
--
-- Finds the length of an array, or of a quasi-array with keys such as "data1",
-- "data2", etc., using an exponential search algorithm. It is similar to the
-- operator #, but may return a different value when there are gaps in the array
-- portion of the table. Intended to be used on data loaded with mw.loadData. For
-- other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of the number
-- of unnamed template parameters, so use this function for frame.args.
------------------------------------------------------------------------------------
function p.length(t, prefix)
-- requiring module inline so that [[Module:Exponential search]] which is
-- only needed by this one function doesn't get millions of transclusions
local expSearch = require("Module:Exponential search")
checkType('length', 1, t, 'table')
checkType('length', 2, prefix, 'string', true)
return expSearch(function (i)
local key
if prefix then
key = prefix .. tostring(i)
else
key = i
end
return t[key] ~= nil
end) or 0
end
------------------------------------------------------------------------------------
-- inArray
--
-- Returns true if valueToFind is a member of the array, and false otherwise.
------------------------------------------------------------------------------------
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
085e7094ac84eb0132ee65822cf3f69cd8ba3d81
Module:InfoboxImage
828
34
73
2023-11-02T18:21:47Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:InfoboxImage]]
Scribunto
text/plain
-- Inputs:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
-- page - page to display for multipage images (DjVu)
-- size - size to display the image
-- maxsize - maximum size for image
-- sizedefault - default size to display the image if size param is blank
-- alt - alt text for image
-- title - title text for image
-- border - set to yes if border
-- center - set to yes, if the image has to be centered
-- upright - upright image param
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
-- link - page to visit when clicking on image
-- class - HTML classes to add to the image
-- Outputs:
-- Formatted image.
-- More details available at the "Module:InfoboxImage/doc" page
local i = {};
local placeholder_image = {
"Blue - Replace this image female.svg",
"Blue - Replace this image male.svg",
"Female no free image yet.png",
"Flag of None (square).svg",
"Flag of None.svg",
"Flag of.svg",
"Green - Replace this image female.svg",
"Green - Replace this image male.svg",
"Image is needed female.svg",
"Image is needed male.svg",
"Location map of None.svg",
"Male no free image yet.png",
"Missing flag.png",
"No flag.svg",
"No free portrait.svg",
"No portrait (female).svg",
"No portrait (male).svg",
"Red - Replace this image female.svg",
"Red - Replace this image male.svg",
"Replace this image female (blue).svg",
"Replace this image female.svg",
"Replace this image male (blue).svg",
"Replace this image male.svg",
"Silver - Replace this image female.svg",
"Silver - Replace this image male.svg",
"Replace this image.svg",
"Cricket no pic.png",
"CarersLogo.gif",
"Diagram Needed.svg",
"Example.jpg",
"Image placeholder.png",
"No male portrait.svg",
"Nocover-upload.png",
"NoDVDcover copy.png",
"Noribbon.svg",
"No portrait-BFD-test.svg",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Sin bandera.svg",
"Sin escudo.svg",
"Replace this image - temple.png",
"Replace this image butterfly.png",
"Replace this image.svg",
"Replace this image1.svg",
"Resolution angle.png",
"Image-No portrait-text-BFD-test.svg",
"Insert image here.svg",
"No image available.png",
"NO IMAGE YET square.png",
"NO IMAGE YET.png",
"No Photo Available.svg",
"No Screenshot.svg",
"No-image-available.jpg",
"Null.png",
"PictureNeeded.gif",
"Place holder.jpg",
"Unbenannt.JPG",
"UploadACopyrightFreeImage.svg",
"UploadAnImage.gif",
"UploadAnImage.svg",
"UploadAnImageShort.svg",
"CarersLogo.gif",
"Diagram Needed.svg",
"No male portrait.svg",
"NoDVDcover copy.png",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Noimage.gif",
}
function i.IsPlaceholder(image)
-- change underscores to spaces
image = mw.ustring.gsub(image, "_", " ");
assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')
-- if image starts with [[ then remove that and anything after |
if mw.ustring.sub(image,1,2) == "[[" then
image = mw.ustring.sub(image,3);
image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");
assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
-- capitalise first letter
image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
for i,j in pairs(placeholder_image) do
if image == j then
return true
end
end
return false
end
function i.InfoboxImage(frame)
local image = frame.args["image"];
if image == "" or image == nil then
return "";
end
if image == " " then
return image;
end
if frame.args["suppressplaceholder"] ~= "no" then
if i.IsPlaceholder(image) == true then
return "";
end
end
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then
return "";
end
if mw.ustring.sub(image,1,2) == "[[" then
-- search for thumbnail images and add to tracking cat if found
local cat = "";
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
cat = "[[Category:Pages using infoboxes with thumbnail images]]";
end
return image .. cat;
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then
return image;
elseif mw.ustring.sub(image,1,1) == "<" then
return image;
elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then
-- Found strip marker at begining, so pass don't process at all
return image;
elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then
-- Found strip marker at begining, so pass don't process at all
return image;
else
local result = "";
local page = frame.args["page"];
local size = frame.args["size"];
local maxsize = frame.args["maxsize"];
local sizedefault = frame.args["sizedefault"];
local alt = frame.args["alt"];
local link = frame.args["link"];
local title = frame.args["title"];
local border = frame.args["border"];
local upright = frame.args["upright"] or "";
local thumbtime = frame.args["thumbtime"] or "";
local center = frame.args["center"];
local class = frame.args["class"];
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
if maxsize ~= "" and maxsize ~= nil then
-- if no sizedefault then set to maxsize
if sizedefault == "" or sizedefault == nil then
sizedefault = maxsize
end
-- check to see if size bigger than maxsize
if size ~= "" and size ~= nil then
local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;
local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;
if sizenumber>maxsizenumber and maxsizenumber>0 then
size = maxsize;
end
end
end
-- add px to size if just a number
if (tonumber(size) or 0) > 0 then
size = size .. "px";
end
-- add px to sizedefault if just a number
if (tonumber(sizedefault) or 0) > 0 then
sizedefault = sizedefault .. "px";
end
result = "[[File:" .. image;
if page ~= "" and page ~= nil then
result = result .. "|page=" .. page;
end
if size ~= "" and size ~= nil then
result = result .. "|" .. size;
elseif sizedefault ~= "" and sizedefault ~= nil then
result = result .. "|" .. sizedefault;
else
result = result .. "|frameless";
end
if center == "yes" then
result = result .. "|center"
end
if alt ~= "" and alt ~= nil then
result = result .. "|alt=" .. alt;
end
if link ~= "" and link ~= nil then
result = result .. "|link=" .. link;
end
if border == "yes" then
result = result .. "|border";
end
if upright == "yes" then
result = result .. "|upright";
elseif upright ~= "" then
result = result .. "|upright=" .. upright;
end
if thumbtime ~= "" then
result = result .. "|thumbtime=" .. thumbtime;
end
if class ~= nil and class ~= "" then
result = result .. "|class=" .. class;
end
-- if alt value is a keyword then do not use as a description
if alt == "thumbnail" or alt == "thumb" or alt == "frameless" or alt == "left" or alt == "center" or alt == "right" or alt == "upright" or alt == "border" or mw.ustring.match(alt or "", '^[0-9]*px$', 1) ~= nil then
alt = nil;
end
if title ~= "" and title ~= nil then
-- does title param contain any templatestyles? If yes then set to blank.
if mw.ustring.match(frame:preprocess(title), 'UNIQ%-%-templatestyles', 1) ~= nil then
title = nil;
end
end
if title ~= "" and title ~= nil then
result = result .. "|" .. title;
end
result = result .. "]]";
return result;
end
end
return i;
0ee5fe75ba239fc5c9cedc81ca11bdc0be068542
Module:Separated entries
828
11
27
2023-11-02T18:21:48Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Separated_entries]]
Scribunto
text/plain
-- This module takes positional parameters as input and concatenates them with
-- an optional separator. The final separator (the "conjunction") can be
-- specified independently, enabling natural-language lists like
-- "foo, bar, baz and qux". The starting parameter can also be specified.
local compressSparseArray = require('Module:TableTools').compressSparseArray
local p = {}
function p._main(args)
local separator = args.separator
-- Decode (convert to Unicode) HTML escape sequences, such as " " for space.
and mw.text.decode(args.separator) or ''
local conjunction = args.conjunction and mw.text.decode(args.conjunction) or separator
-- Discard values before the starting parameter.
local start = tonumber(args.start)
if start then
for i = 1, start - 1 do args[i] = nil end
end
-- Discard named parameters.
local values = compressSparseArray(args)
return mw.text.listToText(values, separator, conjunction)
end
local function makeInvokeFunction(separator, conjunction, first)
return function (frame)
local args = require('Module:Arguments').getArgs(frame)
args.separator = separator or args.separator
args.conjunction = conjunction or args.conjunction
args.first = first or args.first
return p._main(args)
end
end
p.main = makeInvokeFunction()
p.br = makeInvokeFunction('<br />')
p.comma = makeInvokeFunction(mw.message.new('comma-separator'):plain())
return p
e80231ff3de01afd7f62a94e0a34dc1e67504085
Template:Infobox
10
24
53
2023-11-02T18:21:48Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Infobox]]
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
817a9f5b6524eced06a57bd1d5fd7179f9369bf2
Template:Spaced en dash
10
66
137
2023-11-02T18:21:48Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Spaced_en_dash]]
wikitext
text/x-wiki
– <noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
235afe8e7aca71d984c1bba5d8c96db414594b53
Module:Template link general
828
67
139
2023-11-02T18:21:48Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Template_link_general]]
Scribunto
text/plain
-- This implements Template:Tlg
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Is a string non-empty?
local function _ne(s)
return s ~= nil and s ~= ""
end
local nw = mw.text.nowiki
local function addTemplate(s)
local i, _ = s:find(':', 1, true)
if i == nil then
return 'Template:' .. s
end
local ns = s:sub(1, i - 1)
if ns == '' or mw.site.namespaces[ns] then
return s
else
return 'Template:' .. s
end
end
local function trimTemplate(s)
local needle = 'template:'
if s:sub(1, needle:len()):lower() == needle then
return s:sub(needle:len() + 1)
else
return s
end
end
local function linkTitle(args)
if _ne(args.nolink) then
return args['1']
end
local titleObj
local titlePart = '[['
if args['1'] then
-- This handles :Page and other NS
titleObj = mw.title.new(args['1'], 'Template')
else
titleObj = mw.title.getCurrentTitle()
end
titlePart = titlePart .. (titleObj ~= nil and titleObj.fullText or
addTemplate(args['1']))
local textPart = args.alttext
if not _ne(textPart) then
if titleObj ~= nil then
textPart = titleObj:inNamespace("Template") and args['1'] or titleObj.fullText
else
-- redlink
textPart = args['1']
end
end
if _ne(args.subst) then
-- HACK: the ns thing above is probably broken
textPart = 'subst:' .. textPart
end
if _ne(args.brace) then
textPart = nw('{{') .. textPart .. nw('}}')
elseif _ne(args.braceinside) then
textPart = nw('{') .. textPart .. nw('}')
end
titlePart = titlePart .. '|' .. textPart .. ']]'
if _ne(args.braceinside) then
titlePart = nw('{') .. titlePart .. nw('}')
end
return titlePart
end
function p.main(frame)
local args = getArgs(frame, {
trim = true,
removeBlanks = false
})
return p._main(args)
end
function p._main(args)
local bold = _ne(args.bold) or _ne(args.boldlink) or _ne(args.boldname)
local italic = _ne(args.italic) or _ne(args.italics)
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
local code = _ne(args.code) or _ne(args.tt)
local show_result = _ne(args._show_result)
local expand = _ne(args._expand)
-- Build the link part
local titlePart = linkTitle(args)
if bold then titlePart = "'''" .. titlePart .. "'''" end
if _ne(args.nowrapname) then titlePart = '<span class="nowrap">' .. titlePart .. '</span>' end
-- Build the arguments
local textPart = ""
local textPartBuffer = "|"
local codeArguments = {}
local codeArgumentsString = ""
local i = 2
local j = 1
while args[i] do
local val = args[i]
if val ~= "" then
if _ne(args.nowiki) then
-- Unstrip nowiki tags first because calling nw on something that already contains nowiki tags will
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
val = nw(mw.text.unstripNoWiki(val))
end
local k, v = string.match(val, "(.*)=(.*)")
if not k then
codeArguments[j] = val
j = j + 1
else
codeArguments[k] = v
end
codeArgumentsString = codeArgumentsString .. textPartBuffer .. val
if italic then
val = '<span style="font-style:italic;">' .. val .. '</span>'
end
textPart = textPart .. textPartBuffer .. val
end
i = i + 1
end
-- final wrap
local ret = titlePart .. textPart
if not dontBrace then ret = nw('{{') .. ret .. nw('}}') end
if _ne(args.a) then ret = nw('*') .. ' ' .. ret end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
if code then
ret = '<code>' .. ret .. '</code>'
elseif _ne(args.plaincode) then
ret = '<code style="border:none;background:transparent;">' .. ret .. '</code>'
end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
--[[ Wrap as html??
local span = mw.html.create('span')
span:wikitext(ret)
--]]
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
if show_result then
local result = mw.getCurrentFrame():expandTemplate{title = addTemplate(args[1]), args = codeArguments}
ret = ret .. " โ " .. result
end
if expand then
local query = mw.text.encode('{{' .. addTemplate(args[1]) .. string.gsub(codeArgumentsString, textPartBuffer, "|") .. '}}')
local url = mw.uri.fullUrl('special:ExpandTemplates', 'wpInput=' .. query)
mw.log()
ret = ret .. " [" .. tostring(url) .. "]"
end
return ret
end
return p
c7307fa3959d308a2dd7fd2f5009c1ce6db3d122
Module:If empty
828
13
31
2023-11-02T18:21:49Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:If_empty]]
Scribunto
text/plain
local p = {}
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
for k,v in ipairs(args) do
if v ~= '' then
return v
end
end
end
return p
4790391408957dea3ff9f453834c05f6b379a45c
Template:If empty
10
26
57
2023-11-02T18:21:49Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:If_empty]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>{{Documentation}}</noinclude>
745940b7bdde8a1585c887ee4ee5ce81d98461a4
Template:Template other
10
28
61
2023-11-02T18:21:49Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Template_other]]
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Template:Longitem
10
55
115
2023-11-02T18:21:49Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Longitem]]
wikitext
text/x-wiki
<noinclude>{{#tag: code|
</noinclude>{{#ifeq: {{{1|+}}} | {{{1|-}}} | <div style="}}display: inline-block; line-height: 1.2em; padding: .1em 0; {{#ifeq: {{{1|+}}} | {{{1|-}}} | {{{style|}}}">{{{1|}}}</div> | <includeonly>width: 100%;</includeonly> }}<includeonly>{{#if:{{{2|}}}|[[Category:Pages using Template:Longitem with unnamed style parameter]]}}</includeonly><noinclude>
|lang=wikitext}}
{{documentation}}
</noinclude>
2919b818deb36b243e9f9517917cbcfaa2c8d4ec
Template:MONTHNUMBER
10
100
205
2023-11-02T18:21:50Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:MONTHNUMBER]]
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}
|{{#switch:{{lc:{{{1}}}}}
|january|jan=1
|february|feb=2
|march|mar=3
|apr|april=4
|may=5
|june|jun=6
|july|jul=7
|august|aug=8
|september|sep|sept=9
|october|oct=10
|november|nov=11
|december|dec=12
|{{#ifexpr:{{{1}}}<0
|{{#ifexpr:(({{{1}}})round 0)!=({{{1}}})
|{{#expr:12-(((0.5-({{{1}}}))round 0)mod 12)}}
|{{#expr:12-(((11.5-({{{1}}}))round 0)mod 12)}}
}}
|{{#expr:(((10.5+{{{1}}})round 0)mod 12)+1}}
}}
}}
|Missing required parameter 1=''month''!
}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
c2ade663b96231e493986cd17b454923da290098
Module:Navbar
828
39
83
2023-11-02T18:21:51Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Navbar]]
Scribunto
text/plain
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local function get_title_arg(is_collapsible, template)
local title_arg = 1
if is_collapsible then title_arg = 2 end
if template then title_arg = 'template' end
return title_arg
end
local function choose_links(template, args)
-- The show table indicates the default displayed items.
-- view, talk, edit, hist, move, watch
-- TODO: Move to configuration.
local show = {true, true, true, false, false, false}
if template then
show[2] = false
show[3] = false
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6,
talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
-- TODO: Consider removing TableTools dependency.
for _, v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
local remove_edit_link = args.noedit
if remove_edit_link then show[3] = false end
return show
end
local function add_link(link_description, ul, is_mini, font_style)
local l
if link_description.url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-' .. link_description.full)
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:attr('title', link_description.html_title)
:cssText(font_style)
:wikitext(is_mini and link_description.mini or link_description.full)
:done()
:wikitext(l[3])
:done()
end
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
if not title then
error(cfg.invalid_title .. title_text)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- TODO: Get link_descriptions and show into the configuration module.
-- link_descriptions should be easier...
local link_descriptions = {
{ ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template',
['link'] = title.fullText, ['url'] = false },
{ ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template',
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = 'Special:EditPage/' .. title.fullText, ['url'] = false },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = 'Special:PageHistory/' .. title.fullText, ['url'] = false },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template',
['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
local ul = mw.html.create('ul')
if has_brackets then
ul:addClass(cfg.classes.brackets)
:cssText(font_style)
end
for i, _ in ipairs(displayed_links) do
if displayed_links[i] then add_link(link_descriptions[i], ul, is_mini, font_style) end
end
return ul:done()
end
function p._navbar(args)
-- TODO: We probably don't need both fontstyle and fontcolor...
local font_style = args.fontstyle
local font_color = args.fontcolor
local is_collapsible = args.collapsible
local is_mini = args.mini
local is_plain = args.plain
local collapsible_class = nil
if is_collapsible then
collapsible_class = cfg.classes.collapsible
if not is_plain then is_mini = 1 end
if font_color then
font_style = (font_style or '') .. '; color: ' .. font_color .. ';'
end
end
local navbar_style = args.style
local div = mw.html.create():tag('div')
div
:addClass(cfg.classes.navbar)
:addClass(cfg.classes.plainlinks)
:addClass(cfg.classes.horizontal_list)
:addClass(collapsible_class) -- we made the determination earlier
:cssText(navbar_style)
if is_mini then div:addClass(cfg.classes.mini) end
local box_text = (args.text or cfg.box_text) .. ' '
-- the concatenated space guarantees the box text is separated
if not (is_mini or is_plain) then
div
:tag('span')
:addClass(cfg.classes.box_text)
:cssText(font_style)
:wikitext(box_text)
end
local template = args.template
local displayed_links = choose_links(template, args)
local has_brackets = args.brackets
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local list = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(list)
if is_collapsible then
local title_text_class
if is_mini then
title_text_class = cfg.classes.collapsible_title_mini
else
title_text_class = cfg.classes.collapsible_title_full
end
div:done()
:tag('div')
:addClass(title_text_class)
:cssText(font_style)
:wikitext(args[1])
end
local frame = mw.getCurrentFrame()
-- hlist -> navbar is best-effort to preserve old Common.css ordering.
return frame:extensionTag{
name = 'templatestyles', args = { src = cfg.hlist_templatestyles }
} .. frame:extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())
end
function p.navbar(frame)
return p._navbar(require('Module:Arguments').getArgs(frame))
end
return p
047f307758c878eb3e99ed1768cc40920a6ec5fa
Module:Navbar/configuration
828
40
85
2023-11-02T18:21:51Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Navbar/configuration]]
Scribunto
text/plain
return {
['templatestyles'] = 'Module:Navbar/styles.css',
['hlist_templatestyles'] = 'Hlist/styles.css',
['box_text'] = 'This box: ', -- default text box when not plain or mini
['title_namespace'] = 'Template', -- namespace to default to for title
['invalid_title'] = 'Invalid title ',
['classes'] = { -- set a line to nil if you don't want it
['navbar'] = 'navbar',
['plainlinks'] = 'plainlinks', -- plainlinks
['horizontal_list'] = 'hlist', -- horizontal list class
['mini'] = 'navbar-mini', -- class indicating small links in the navbar
['this_box'] = 'navbar-boxtext',
['brackets'] = 'navbar-brackets',
-- 'collapsible' is the key for a class to indicate the navbar is
-- setting up the collapsible element in addition to the normal
-- navbar.
['collapsible'] = 'navbar-collapse',
['collapsible_title_mini'] = 'navbar-ct-mini',
['collapsible_title_full'] = 'navbar-ct-full'
}
}
b007c336b17ec4bcd4d5a9dca9f8cba301662b55
Template:MONTHNAME
10
99
203
2023-11-02T18:21:51Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:MONTHNAME]]
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}|{{#switch:{{MONTHNUMBER|{{{1}}}}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=''month''!}}|Missing required parameter 1=''month''!}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
25327282f70efd1189b70245a0e23509f3bb65e6
Module:Navbox
828
38
81
2023-11-02T18:21:52Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Navbox]]
Scribunto
text/plain
require('strict')
local p = {}
local navbar = require('Module:Navbar')._navbar
local cfg = mw.loadData('Module:Navbox/configuration')
local getArgs -- lazily initialized
local args
local format = string.format
local function striped(wikitext, border)
-- Return wikitext with markers replaced for odd/even striping.
-- Child (subgroup) navboxes are flagged with a category that is removed
-- by parent navboxes. The result is that the category shows all pages
-- where a child navbox is not contained in a parent navbox.
local orphanCat = cfg.category.orphan
if border == cfg.keyword.border_subgroup and args[cfg.arg.orphan] ~= cfg.keyword.orphan_yes then
-- No change; striping occurs in outermost navbox.
return wikitext .. orphanCat
end
local first, second = cfg.class.navbox_odd_part, cfg.class.navbox_even_part
if args[cfg.arg.evenodd] then
if args[cfg.arg.evenodd] == cfg.keyword.evenodd_swap then
first, second = second, first
else
first = args[cfg.arg.evenodd]
second = first
end
end
local changer
if first == second then
changer = first
else
local index = 0
changer = function (code)
if code == '0' then
-- Current occurrence is for a group before a nested table.
-- Set it to first as a valid although pointless class.
-- The next occurrence will be the first row after a title
-- in a subgroup and will also be first.
index = 0
return first
end
index = index + 1
return index % 2 == 1 and first or second
end
end
local regex = orphanCat:gsub('([%[%]])', '%%%1')
return (wikitext:gsub(regex, ''):gsub(cfg.marker.regex, changer)) -- () omits gsub count
end
local function processItem(item, nowrapitems)
if item:sub(1, 2) == '{|' then
-- Applying nowrap to lines in a table does not make sense.
-- Add newlines to compensate for trim of x in |parm=x in a template.
return '\n' .. item ..'\n'
end
if nowrapitems == cfg.keyword.nowrapitems_yes then
local lines = {}
for line in (item .. '\n'):gmatch('([^\n]*)\n') do
local prefix, content = line:match('^([*:;#]+)%s*(.*)')
if prefix and not content:match(cfg.pattern.nowrap) then
line = format(cfg.nowrap_item, prefix, content)
end
table.insert(lines, line)
end
item = table.concat(lines, '\n')
end
if item:match('^[*:;#]') then
return '\n' .. item ..'\n'
end
return item
end
local function has_navbar()
return args[cfg.arg.navbar] ~= cfg.keyword.navbar_off
and args[cfg.arg.navbar] ~= cfg.keyword.navbar_plain
and (
args[cfg.arg.name]
or mw.getCurrentFrame():getParent():getTitle():gsub(cfg.pattern.sandbox, '')
~= cfg.pattern.navbox
)
end
local function renderNavBar(titleCell)
if has_navbar() then
titleCell:wikitext(navbar{
[cfg.navbar.name] = args[cfg.arg.name],
[cfg.navbar.mini] = 1,
[cfg.navbar.fontstyle] = (args[cfg.arg.basestyle] or '') .. ';' ..
(args[cfg.arg.titlestyle] or '') ..
';background:none transparent;border:none;box-shadow:none;padding:0;'
})
end
end
local function renderTitleRow(tbl)
if not args[cfg.arg.title] then return end
local titleRow = tbl:tag('tr')
local titleCell = titleRow:tag('th'):attr('scope', 'col')
local titleColspan = 2
if args[cfg.arg.imageleft] then titleColspan = titleColspan + 1 end
if args[cfg.arg.image] then titleColspan = titleColspan + 1 end
titleCell
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.titlestyle])
:addClass(cfg.class.navbox_title)
:attr('colspan', titleColspan)
renderNavBar(titleCell)
titleCell
:tag('div')
-- id for aria-labelledby attribute
:attr('id', mw.uri.anchorEncode(args[cfg.arg.title]))
:addClass(args[cfg.arg.titleclass])
:css('font-size', '114%')
:css('margin', '0 4em')
:wikitext(processItem(args[cfg.arg.title]))
end
local function getAboveBelowColspan()
local ret = 2
if args[cfg.arg.imageleft] then ret = ret + 1 end
if args[cfg.arg.image] then ret = ret + 1 end
return ret
end
local function renderAboveRow(tbl)
if not args[cfg.arg.above] then return end
tbl:tag('tr')
:tag('td')
:addClass(cfg.class.navbox_abovebelow)
:addClass(args[cfg.arg.aboveclass])
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.abovestyle])
:attr('colspan', getAboveBelowColspan())
:tag('div')
-- id for aria-labelledby attribute, if no title
:attr('id', (not args[cfg.arg.title]) and mw.uri.anchorEncode(args[cfg.arg.above]) or nil)
:wikitext(processItem(args[cfg.arg.above], args[cfg.arg.nowrapitems]))
end
local function renderBelowRow(tbl)
if not args[cfg.arg.below] then return end
tbl:tag('tr')
:tag('td')
:addClass(cfg.class.navbox_abovebelow)
:addClass(args[cfg.arg.belowclass])
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.belowstyle])
:attr('colspan', getAboveBelowColspan())
:tag('div')
:wikitext(processItem(args[cfg.arg.below], args[cfg.arg.nowrapitems]))
end
local function renderListRow(tbl, index, listnum, listnums_size)
local row = tbl:tag('tr')
if index == 1 and args[cfg.arg.imageleft] then
row
:tag('td')
:addClass(cfg.class.noviewer)
:addClass(cfg.class.navbox_image)
:addClass(args[cfg.arg.imageclass])
:css('width', '1px') -- Minimize width
:css('padding', '0 2px 0 0')
:cssText(args[cfg.arg.imageleftstyle])
:attr('rowspan', listnums_size)
:tag('div')
:wikitext(processItem(args[cfg.arg.imageleft]))
end
local group_and_num = format(cfg.arg.group_and_num, listnum)
local groupstyle_and_num = format(cfg.arg.groupstyle_and_num, listnum)
if args[group_and_num] then
local groupCell = row:tag('th')
-- id for aria-labelledby attribute, if lone group with no title or above
if listnum == 1 and not (args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group2]) then
groupCell
:attr('id', mw.uri.anchorEncode(args[cfg.arg.group1]))
end
groupCell
:attr('scope', 'row')
:addClass(cfg.class.navbox_group)
:addClass(args[cfg.arg.groupclass])
:cssText(args[cfg.arg.basestyle])
-- If groupwidth not specified, minimize width
:css('width', args[cfg.arg.groupwidth] or '1%')
groupCell
:cssText(args[cfg.arg.groupstyle])
:cssText(args[groupstyle_and_num])
:wikitext(args[group_and_num])
end
local listCell = row:tag('td')
if args[group_and_num] then
listCell
:addClass(cfg.class.navbox_list_with_group)
else
listCell:attr('colspan', 2)
end
if not args[cfg.arg.groupwidth] then
listCell:css('width', '100%')
end
local rowstyle -- usually nil so cssText(rowstyle) usually adds nothing
if index % 2 == 1 then
rowstyle = args[cfg.arg.oddstyle]
else
rowstyle = args[cfg.arg.evenstyle]
end
local list_and_num = format(cfg.arg.list_and_num, listnum)
local listText = args[list_and_num]
local oddEven = cfg.marker.oddeven
if listText:sub(1, 12) == '</div><table' then
-- Assume list text is for a subgroup navbox so no automatic striping for this row.
oddEven = listText:find(cfg.pattern.navbox_title) and cfg.marker.restart or cfg.class.navbox_odd_part
end
local liststyle_and_num = format(cfg.arg.liststyle_and_num, listnum)
local listclass_and_num = format(cfg.arg.listclass_and_num, listnum)
listCell
:css('padding', '0')
:cssText(args[cfg.arg.liststyle])
:cssText(rowstyle)
:cssText(args[liststyle_and_num])
:addClass(cfg.class.navbox_list)
:addClass(cfg.class.navbox_part .. oddEven)
:addClass(args[cfg.arg.listclass])
:addClass(args[listclass_and_num])
:tag('div')
:css('padding',
(index == 1 and args[cfg.arg.list1padding]) or args[cfg.arg.listpadding] or '0 0.25em'
)
:wikitext(processItem(listText, args[cfg.arg.nowrapitems]))
if index == 1 and args[cfg.arg.image] then
row
:tag('td')
:addClass(cfg.class.noviewer)
:addClass(cfg.class.navbox_image)
:addClass(args[cfg.arg.imageclass])
:css('width', '1px') -- Minimize width
:css('padding', '0 0 0 2px')
:cssText(args[cfg.arg.imagestyle])
:attr('rowspan', listnums_size)
:tag('div')
:wikitext(processItem(args[cfg.arg.image]))
end
end
local function has_list_class(htmlclass)
local patterns = {
'^' .. htmlclass .. '$',
'%s' .. htmlclass .. '$',
'^' .. htmlclass .. '%s',
'%s' .. htmlclass .. '%s'
}
for arg, _ in pairs(args) do
if type(arg) == 'string' and mw.ustring.find(arg, cfg.pattern.class) then
for _, pattern in ipairs(patterns) do
if mw.ustring.find(args[arg] or '', pattern) then
return true
end
end
end
end
return false
end
-- there are a lot of list classes in the wild, so we add their TemplateStyles
local function add_list_styles()
local frame = mw.getCurrentFrame()
local function add_list_templatestyles(htmlclass, templatestyles)
if has_list_class(htmlclass) then
return frame:extensionTag{
name = 'templatestyles', args = { src = templatestyles }
}
else
return ''
end
end
local hlist_styles = add_list_templatestyles('hlist', cfg.hlist_templatestyles)
local plainlist_styles = add_list_templatestyles('plainlist', cfg.plainlist_templatestyles)
-- a second workaround for [[phab:T303378]]
-- when that issue is fixed, we can actually use has_navbar not to emit the
-- tag here if we want
if has_navbar() and hlist_styles == '' then
hlist_styles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.hlist_templatestyles }
}
end
-- hlist -> plainlist is best-effort to preserve old Common.css ordering.
-- this ordering is not a guarantee because most navboxes will emit only
-- one of these classes [hlist_note]
return hlist_styles .. plainlist_styles
end
local function needsHorizontalLists(border)
if border == cfg.keyword.border_subgroup or args[cfg.arg.tracking] == cfg.keyword.tracking_no then
return false
end
return not has_list_class(cfg.pattern.hlist) and not has_list_class(cfg.pattern.plainlist)
end
local function hasBackgroundColors()
for _, key in ipairs({cfg.arg.titlestyle, cfg.arg.groupstyle,
cfg.arg.basestyle, cfg.arg.abovestyle, cfg.arg.belowstyle}) do
if tostring(args[key]):find('background', 1, true) then
return true
end
end
return false
end
local function hasBorders()
for _, key in ipairs({cfg.arg.groupstyle, cfg.arg.basestyle,
cfg.arg.abovestyle, cfg.arg.belowstyle}) do
if tostring(args[key]):find('border', 1, true) then
return true
end
end
return false
end
local function isIllegible()
local styleratio = require('Module:Color contrast')._styleratio
for key, style in pairs(args) do
if tostring(key):match(cfg.pattern.style) then
if styleratio{mw.text.unstripNoWiki(style)} < 4.5 then
return true
end
end
end
return false
end
local function getTrackingCategories(border)
local cats = {}
if needsHorizontalLists(border) then table.insert(cats, cfg.category.horizontal_lists) end
if hasBackgroundColors() then table.insert(cats, cfg.category.background_colors) end
if isIllegible() then table.insert(cats, cfg.category.illegible) end
if hasBorders() then table.insert(cats, cfg.category.borders) end
return cats
end
local function renderTrackingCategories(builder, border)
local title = mw.title.getCurrentTitle()
if title.namespace ~= 10 then return end -- not in template space
local subpage = title.subpageText
if subpage == cfg.keyword.subpage_doc or subpage == cfg.keyword.subpage_sandbox
or subpage == cfg.keyword.subpage_testcases then return end
for _, cat in ipairs(getTrackingCategories(border)) do
builder:wikitext('[[Category:' .. cat .. ']]')
end
end
local function renderMainTable(border, listnums)
local tbl = mw.html.create('table')
:addClass(cfg.class.nowraplinks)
:addClass(args[cfg.arg.bodyclass])
local state = args[cfg.arg.state]
if args[cfg.arg.title] and state ~= cfg.keyword.state_plain and state ~= cfg.keyword.state_off then
if state == cfg.keyword.state_collapsed then
state = cfg.class.collapsed
end
tbl
:addClass(cfg.class.collapsible)
:addClass(state or cfg.class.autocollapse)
end
tbl:css('border-spacing', 0)
if border == cfg.keyword.border_subgroup or border == cfg.keyword.border_none then
tbl
:addClass(cfg.class.navbox_subgroup)
:cssText(args[cfg.arg.bodystyle])
:cssText(args[cfg.arg.style])
else -- regular navbox - bodystyle and style will be applied to the wrapper table
tbl
:addClass(cfg.class.navbox_inner)
:css('background', 'transparent')
:css('color', 'inherit')
end
tbl:cssText(args[cfg.arg.innerstyle])
renderTitleRow(tbl)
renderAboveRow(tbl)
local listnums_size = #listnums
for i, listnum in ipairs(listnums) do
renderListRow(tbl, i, listnum, listnums_size)
end
renderBelowRow(tbl)
return tbl
end
local function add_navbox_styles(hiding_templatestyles)
local frame = mw.getCurrentFrame()
-- This is a lambda so that it doesn't need the frame as a parameter
local function add_user_styles(templatestyles)
if templatestyles and templatestyles ~= '' then
return frame:extensionTag{
name = 'templatestyles', args = { src = templatestyles }
}
end
return ''
end
-- get templatestyles. load base from config so that Lua only needs to do
-- the work once of parser tag expansion
local base_templatestyles = cfg.templatestyles
local templatestyles = add_user_styles(args[cfg.arg.templatestyles])
local child_templatestyles = add_user_styles(args[cfg.arg.child_templatestyles])
-- The 'navbox-styles' div exists to wrap the styles to work around T200206
-- more elegantly. Instead of combinatorial rules, this ends up being linear
-- number of CSS rules.
return mw.html.create('div')
:addClass(cfg.class.navbox_styles)
:wikitext(
add_list_styles() .. -- see [hlist_note] applied to 'before base_templatestyles'
base_templatestyles ..
templatestyles ..
child_templatestyles ..
table.concat(hiding_templatestyles)
)
:done()
end
-- work around [[phab:T303378]]
-- for each arg: find all the templatestyles strip markers, insert them into a
-- table. then remove all templatestyles markers from the arg
local function move_hiding_templatestyles(args)
local gfind = string.gfind
local gsub = string.gsub
local templatestyles_markers = {}
local strip_marker_pattern = '(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)'
for k, arg in pairs(args) do
for marker in gfind(arg, strip_marker_pattern) do
table.insert(templatestyles_markers, marker)
end
args[k] = gsub(arg, strip_marker_pattern, '')
end
return templatestyles_markers
end
function p._navbox(navboxArgs)
args = navboxArgs
local hiding_templatestyles = move_hiding_templatestyles(args)
local listnums = {}
for k, _ in pairs(args) do
if type(k) == 'string' then
local listnum = k:match(cfg.pattern.listnum)
if listnum then table.insert(listnums, tonumber(listnum)) end
end
end
table.sort(listnums)
local border = mw.text.trim(args[cfg.arg.border] or args[1] or '')
if border == cfg.keyword.border_child then
border = cfg.keyword.border_subgroup
end
-- render the main body of the navbox
local tbl = renderMainTable(border, listnums)
local res = mw.html.create()
-- render the appropriate wrapper for the navbox, based on the border param
if border == cfg.keyword.border_none then
res:node(add_navbox_styles(hiding_templatestyles))
local nav = res:tag('div')
:attr('role', 'navigation')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args[cfg.arg.title] or args[cfg.arg.above] or (args[cfg.arg.group1]
and not args[cfg.arg.group2]) then
nav:attr(
'aria-labelledby',
mw.uri.anchorEncode(
args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1]
)
)
else
nav:attr('aria-label', cfg.aria_label)
end
elseif border == cfg.keyword.border_subgroup then
-- We assume that this navbox is being rendered in a list cell of a
-- parent navbox, and is therefore inside a div with padding:0em 0.25em.
-- We start with a </div> to avoid the padding being applied, and at the
-- end add a <div> to balance out the parent's </div>
res
:wikitext('</div>')
:node(tbl)
:wikitext('<div>')
else
res:node(add_navbox_styles(hiding_templatestyles))
local nav = res:tag('div')
:attr('role', 'navigation')
:addClass(cfg.class.navbox)
:addClass(args[cfg.arg.navboxclass])
:cssText(args[cfg.arg.bodystyle])
:cssText(args[cfg.arg.style])
:css('padding', '3px')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args[cfg.arg.title] or args[cfg.arg.above]
or (args[cfg.arg.group1] and not args[cfg.arg.group2]) then
nav:attr(
'aria-labelledby',
mw.uri.anchorEncode(args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1])
)
else
nav:attr('aria-label', cfg.aria_label)
end
end
if (args[cfg.arg.nocat] or cfg.keyword.nocat_false):lower() == cfg.keyword.nocat_false then
renderTrackingCategories(res, border)
end
return striped(tostring(res), border)
end
function p.navbox(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {wrappers = {cfg.pattern.navbox}})
-- Read the arguments in the order they'll be output in, to make references
-- number in the right order.
local _
_ = args[cfg.arg.title]
_ = args[cfg.arg.above]
-- Limit this to 20 as covering 'most' cases (that's a SWAG) and because
-- iterator approach won't work here
for i = 1, 20 do
_ = args[format(cfg.arg.group_and_num, i)]
_ = args[format(cfg.arg.list_and_num, i)]
end
_ = args[cfg.arg.below]
return p._navbox(args)
end
return p
05be9a97c035ab3f0fac69423779e261949d473c
Module:Navbox/configuration
828
41
87
2023-11-02T18:21:52Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Navbox/configuration]]
Scribunto
text/plain
return {
aria_label = 'Navbox',
nowrap_item = '%s<span class="nowrap">%s</span>',
templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Navbox/styles.css' }
},
hlist_templatestyles = 'Hlist/styles.css',
plainlist_templatestyles = 'Plainlist/styles.css',
-- do not localize marker table
marker = {
oddeven = '\127_ODDEVEN_\127',
restart = '\127_ODDEVEN0_\127',
regex = '\127_ODDEVEN(%d?)_\127'
},
category = {
orphan = '[[Category:Navbox orphans]]',
horizontal_lists = 'Navigational boxes without horizontal lists',
background_colors = 'Navboxes using background colours',
illegible = 'Potentially illegible navboxes',
borders = 'Navboxes using borders',
},
keyword = {
border_subgroup = 'subgroup',
border_child = 'child',
border_none = 'none',
evenodd_swap = 'swap',
navbar_off = 'off',
navbar_plain = 'plain',
nocat_false = 'false',
nowrapitems_yes = 'yes',
orphan_yes = 'yes',
state_collapsed = 'collapsed',
state_off = 'off',
state_plain = 'plain',
subpage_doc = 'doc',
subpage_sandbox = 'sandbox',
subpage_testcases = 'testcases',
tracking_no = 'no'
},
class = {
autocollapse = 'autocollapse',
collapsible = 'mw-collapsible',
collapsed = 'mw-collapsed',
-- Warning
navbox = 'navbox', -- WMF currently hides 'navbox' from mobile,
-- so you probably shouldn't change the navbox class.
navbox_abovebelow = 'navbox-abovebelow',
navbox_group = 'navbox-group',
navbox_image = 'navbox-image',
navbox_inner = 'navbox-inner',
navbox_list = 'navbox-list',
navbox_list_with_group = 'navbox-list-with-group',
navbox_part = 'navbox-', -- do not l10n
navbox_styles = 'navbox-styles',
navbox_subgroup = 'navbox-subgroup',
navbox_title = 'navbox-title', -- l10n only if you change pattern.navbox_title below
navbox_odd_part = 'odd', -- do not l10n
navbox_even_part = 'even', -- do not l10n
nomobile = 'nomobile',
nowraplinks = 'nowraplinks',
noviewer = 'noviewer' -- used to remove images from MediaViewer
},
pattern = {
listnum = '^list(%d+)$',
class = 'class',
sandbox = '/sandbox$',
navbox = 'Template:Navbox',
nowrap = '^<span class="nowrap">',
style = 'style$',
navbox_title = '<th[^>]*"navbox%-title"',
hlist = 'hlist',
plainlist = 'plainlist',
},
arg = {
above = 'above',
aboveclass = 'aboveclass',
abovestyle = 'abovestyle',
basestyle = 'basestyle',
bodyclass = 'bodyclass',
bodystyle = 'bodystyle',
border = 'border',
below = 'below',
belowclass = 'belowclass',
belowstyle = 'belowstyle',
evenodd = 'evenodd',
evenstyle = 'evenstyle',
group1 = 'group1',
group2 = 'group2',
group_and_num = 'group%d',
groupstyle_and_num = 'group%dstyle',
groupclass = 'groupclass',
groupstyle = 'groupstyle',
groupwidth = 'groupwidth',
innerstyle = 'innerstyle',
image = 'image',
imageclass = 'imageclass',
imageleft = 'imageleft',
imageleftstyle = 'imageleftstyle',
imagesetyle = 'imagestyle',
list_and_num = 'list%d',
listclass_and_num = 'list%dclass',
liststyle_and_num = 'list%dstyle',
list1padding = 'list1padding',
listclass = 'listclass',
listpadding = 'listpadding',
liststyle = 'liststyle',
name = 'name',
navbar = 'navbar',
navboxclass = 'navboxclass',
nocat = 'nocat',
nowrapitems = 'nowrapitems',
oddstyle = 'oddstyle',
orphan = 'orphan',
state = 'state',
style = 'style',
templatestyles = 'templatestyles',
child_templatestyles = 'child templatestyles',
title = 'title',
titleclass = 'titleclass',
titlestyle = 'titlestyle',
tracking = 'tracking'
},
-- names of navbar arguments
navbar = {
name = 1,
fontstyle = 'fontstyle',
mini = 'mini'
}
}
4148736fd32a93636c0413e73ed38afaef065ec9
Template:Yesno-no
10
47
99
2023-11-02T18:21:53Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Yesno-no]]
wikitext
text/x-wiki
{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|ยฌ={{{ยฌ|no}}}|def={{{def|no}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1ad7b7800da1b867ead8f6ff8cef76e6201b3b56
Template:Coord
10
76
157
2023-11-02T18:21:53Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Coord]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Coordinates|coord}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
05c1e2a95ff86fa91442c704f36a9f125b603492
Template:Flag
10
72
149
2023-11-02T18:21:54Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Flag]]
wikitext
text/x-wiki
{{country data {{{1|}}}|flag/core|name={{{name|{{{1|}}}}}}|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude>{{documentation}}</noinclude>
d13aac8e23bee030a6fc9b49a8aa1135104ace22
Template:Flag/core
10
74
153
2023-11-02T18:21:54Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Flag/core]]
wikitext
text/x-wiki
<span class="flagicon">[[File:{{{flag alias-{{{variant}}}|{{#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt=|link=]] {{#switch:{{{flag alias}}}|Flag of Switzerland.svg|Flag of the Vatican City.svg|Flag of Switzerland (Pantone).svg|Flag of Vatican City State - 2023 version.svg= }}{{#ifeq:{{{alias}}}|Nepal| }}</span>[[{{{alias}}}|{{{name}}}]]<noinclude>{{documentation}}</noinclude>
0714064913bcc5abd9dae55d4fb50f52965eef35
Module:Color contrast
828
42
89
2023-11-02T18:21:55Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Color_contrast]]
Scribunto
text/plain
--
-- This module implements
-- {{Color contrast ratio}}
-- {{Greater color contrast ratio}}
-- {{ColorToLum}}
-- {{RGBColorToLum}}
--
local p = {}
local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' )
local function sRGB (v)
if (v <= 0.03928) then
v = v / 12.92
else
v = math.pow((v+0.055)/1.055, 2.4)
end
return v
end
local function rgbdec2lum(R, G, B)
if ( 0 <= R and R < 256 and 0 <= G and G < 256 and 0 <= B and B < 256 ) then
return 0.2126 * sRGB(R/255) + 0.7152 * sRGB(G/255) + 0.0722 * sRGB(B/255)
else
return ''
end
end
local function hsl2lum(h, s, l)
if ( 0 <= h and h < 360 and 0 <= s and s <= 1 and 0 <= l and l <= 1 ) then
local c = (1 - math.abs(2*l - 1))*s
local x = c*(1 - math.abs( math.fmod(h/60, 2) - 1) )
local m = l - c/2
local r, g, b = m, m, m
if( 0 <= h and h < 60 ) then
r = r + c
g = g + x
elseif( 60 <= h and h < 120 ) then
r = r + x
g = g + c
elseif( 120 <= h and h < 180 ) then
g = g + c
b = b + x
elseif( 180 <= h and h < 240 ) then
g = g + x
b = b + c
elseif( 240 <= h and h < 300 ) then
r = r + x
b = b + c
elseif( 300 <= h and h < 360 ) then
r = r + c
b = b + x
end
return rgbdec2lum(255*r, 255*g, 255*b)
else
return ''
end
end
local function color2lum(c)
if (c == nil) then
return ''
end
-- html '#' entity
c = c:gsub("#", "#")
-- whitespace
c = c:match( '^%s*(.-)[%s;]*$' )
-- unstrip nowiki strip markers
c = mw.text.unstripNoWiki(c)
-- lowercase
c = c:lower()
-- first try to look it up
local L = HTMLcolor[c]
if (L ~= nil) then
return L
end
-- convert from hsl
if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9%.]*[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9%.]*)[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100)
end
-- convert from rgb
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*%)$')
return rgbdec2lum(tonumber(R), tonumber(G), tonumber(B))
end
-- convert from rgb percent
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100)
end
-- remove leading # (if there is one) and whitespace
c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$')
-- split into rgb
local cs = mw.text.split(c or '', '')
if( #cs == 6 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[2])
local G = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[4])
local B = 16*tonumber('0x' .. cs[5]) + tonumber('0x' .. cs[6])
return rgbdec2lum(R, G, B)
elseif ( #cs == 3 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[1])
local G = 16*tonumber('0x' .. cs[2]) + tonumber('0x' .. cs[2])
local B = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[3])
return rgbdec2lum(R, G, B)
end
-- failure, return blank
return ''
end
-- This exports the function for use in other modules.
-- The colour is passed as a string.
function p._lum(color)
return color2lum(color)
end
function p._greatercontrast(args)
local bias = tonumber(args['bias'] or '0') or 0
local css = (args['css'] and args['css'] ~= '') and true or false
local v1 = color2lum(args[1] or '')
local c2 = args[2] or '#FFFFFF'
local v2 = color2lum(c2)
local c3 = args[3] or '#000000'
local v3 = color2lum(c3)
local ratio1 = -1;
local ratio2 = -1;
if (type(v1) == 'number' and type(v2) == 'number') then
ratio1 = (v2 + 0.05)/(v1 + 0.05)
ratio1 = (ratio1 < 1) and 1/ratio1 or ratio1
end
if (type(v1) == 'number' and type(v3) == 'number') then
ratio2 = (v3 + 0.05)/(v1 + 0.05)
ratio2 = (ratio2 < 1) and 1/ratio2 or ratio2
end
if css then
local c1 = args[1] or ''
if mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c1 = '#' .. c1
end
if mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c2 = '#' .. c2
end
if mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c3 = '#' .. c3
end
return 'background-color:' .. c1 .. '; color:' .. ((ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or '') .. ';'
end
return (ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or ''
end
function p._ratio(args)
local v1 = color2lum(args[1])
local v2 = color2lum(args[2])
if (type(v1) == 'number' and type(v2) == 'number') then
-- v1 should be the brighter of the two.
if v2 > v1 then
v1, v2 = v2, v1
end
return (v1 + 0.05)/(v2 + 0.05)
else
return args['error'] or '?'
end
end
function p._styleratio(args)
local style = (args[1] or ''):lower()
local bg, fg = 'white', 'black'
local lum_bg, lum_fg = 1, 0
if args[2] then
local lum = color2lum(args[2])
if lum ~= '' then bg, lum_bg = args[2], lum end
end
if args[3] then
local lum = color2lum(args[3])
if lum ~= '' then fg, lum_fg = args[3], lum end
end
local slist = mw.text.split(mw.ustring.gsub(mw.ustring.gsub(style or '', '&#[Xx]23;', '#'), '#', '#'), ';')
for k = 1,#slist do
local s = slist[k]
local k,v = s:match( '^[%s]*([^:]-):([^:]-)[%s;]*$' )
k = k or ''
v = v or ''
if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background%-color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_bg = v, lum end
elseif (k:match('^[%s]*(color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_fg = v, lum end
end
end
if lum_bg > lum_fg then
return (lum_bg + 0.05)/(lum_fg + 0.05)
else
return (lum_fg + 0.05)/(lum_bg + 0.05)
end
end
--[[
Use {{#invoke:Color contrast|somecolor}} directly or
{{#invoke:Color contrast}} from a wrapper template.
Parameters:
-- |1= โ required; A color to check.
--]]
function p.lum(frame)
local color = frame.args[1] or frame:getParent().args[1]
return p._lum(color)
end
function p.ratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._ratio(args)
end
function p.styleratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._styleratio(args)
end
function p.greatercontrast(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._greatercontrast(args)
end
return p
1e399769117591366a63f62996c9a407077cc711
Module:Color contrast/colors
828
43
91
2023-11-02T18:21:55Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Color_contrast/colors]]
Scribunto
text/plain
return {
aliceblue = 0.92880068253475,
antiquewhite = 0.84646951707754,
aqua = 0.7874,
aquamarine = 0.8078549208338,
azure = 0.97265264954166,
beige = 0.8988459998705,
bisque = 0.80732327372979,
black = 0,
blanchedalmond = 0.85084439608156,
blue = 0.0722,
blueviolet = 0.12622014321946,
brown = 0.098224287876511,
burlywood = 0.51559844533893,
cadetblue = 0.29424681085422,
chartreuse = 0.76032025902623,
chocolate = 0.23898526114557,
coral = 0.37017930872924,
cornflowerblue = 0.30318641994179,
cornsilk = 0.93562110372965,
crimson = 0.16042199953026,
cyan = 0.7874,
darkblue = 0.018640801980939,
darkcyan = 0.20329317839046,
darkgoldenrod = 0.27264703559993,
darkgray = 0.39675523072563,
darkgreen = 0.091143429047575,
darkgrey = 0.39675523072563,
darkkhaki = 0.45747326349994,
darkmagenta = 0.07353047651207,
darkolivegreen = 0.12651920884889,
darkorange = 0.40016167026524,
darkorchid = 0.13413142174857,
darkred = 0.054889674531132,
darksalmon = 0.40541471563381,
darkseagreen = 0.43789249325969,
darkslateblue = 0.065792846227988,
darkslategray = 0.067608151928044,
darkslategrey = 0.067608151928044,
darkturquoise = 0.4874606277449,
darkviolet = 0.10999048339343,
deeppink = 0.23866895828276,
deepskyblue = 0.44481603395575,
dimgray = 0.14126329114027,
dimgrey = 0.14126329114027,
dodgerblue = 0.27442536991456,
firebrick = 0.10724525535015,
floralwhite = 0.95922484825004,
forestgreen = 0.18920812076002,
fuchsia = 0.2848,
gainsboro = 0.71569350050648,
ghostwhite = 0.94311261886323,
gold = 0.69860877428159,
goldenrod = 0.41919977809569,
gray = 0.2158605001139,
green = 0.15438342968146,
greenyellow = 0.80609472611453,
grey = 0.2158605001139,
honeydew = 0.96336535554782,
hotpink = 0.34658438169715,
indianred = 0.21406134963884,
indigo = 0.03107561486337,
ivory = 0.99071270600615,
khaki = 0.77012343394121,
lavender = 0.80318750514521,
lavenderblush = 0.90172748631046,
lawngreen = 0.73905893124963,
lemonchiffon = 0.94038992245622,
lightblue = 0.63709141280807,
lightcoral = 0.35522120733135,
lightcyan = 0.94587293494829,
lightgoldenrodyellow = 0.93348351018297,
lightgray = 0.65140563741982,
lightgreen = 0.69091979956865,
lightgrey = 0.65140563741982,
lightpink = 0.58566152734898,
lightsalmon = 0.4780675225206,
lightseagreen = 0.35050145117042,
lightskyblue = 0.56195637618331,
lightslategray = 0.23830165007287,
lightslategrey = 0.23830165007287,
lightsteelblue = 0.53983888284666,
lightyellow = 0.98161818392882,
lime = 0.7152,
limegreen = 0.44571042246098,
linen = 0.88357340984379,
magenta = 0.2848,
maroon = 0.045891942324215,
mediumaquamarine = 0.49389703310801,
mediumblue = 0.044077780212328,
mediumorchid = 0.21639251153773,
mediumpurple = 0.22905858091648,
mediumseagreen = 0.34393112338131,
mediumslateblue = 0.20284629471622,
mediumspringgreen = 0.70704308194184,
mediumturquoise = 0.5133827926448,
mediumvioletred = 0.14371899849357,
midnightblue = 0.02071786635086,
mintcream = 0.97834604947588,
mistyrose = 0.82183047859185,
moccasin = 0.80083000991567,
navajowhite = 0.76519682342785,
navy = 0.015585128108224,
oldlace = 0.91900633405549,
olive = 0.20027537200568,
olivedrab = 0.22593150951929,
orange = 0.4817026703631,
orangered = 0.25516243753416,
orchid = 0.31348806761439,
palegoldenrod = 0.78792647887614,
palegreen = 0.77936759006353,
paleturquoise = 0.76436077921714,
palevioletred = 0.28754994117889,
papayawhip = 0.87797100199835,
peachpuff = 0.74905589878251,
peru = 0.30113074877936,
pink = 0.63271070702466,
plum = 0.45734221587969,
powderblue = 0.68254586500605,
purple = 0.061477070432439,
rebeccapurple = 0.07492341159447,
red = 0.2126,
rosybrown = 0.32319457649407,
royalblue = 0.16663210743188,
saddlebrown = 0.097922285020521,
salmon = 0.36977241527596,
sandybrown = 0.46628543696283,
seagreen = 0.19734199706275,
seashell = 0.92737862206922,
sienna = 0.13697631337098,
silver = 0.52711512570581,
skyblue = 0.55291668518184,
slateblue = 0.14784278062136,
slategray = 0.20896704076536,
slategrey = 0.20896704076536,
snow = 0.96533341834849,
springgreen = 0.73052306068529,
steelblue = 0.20562642207625,
tan = 0.48237604163921,
teal = 0.16996855778968,
thistle = 0.56818401093733,
tomato = 0.30638612719415,
turquoise = 0.5895536427578,
violet = 0.40315452986676,
wheat = 0.74909702820482,
white = 1,
whitesmoke = 0.91309865179342,
yellow = 0.9278,
yellowgreen = 0.50762957208707,
}
6ae47fdb24de4eed5ec26d203faf5341a388987b
Template:Flagicon
10
69
143
2023-11-02T18:21:55Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Flagicon]]
wikitext
text/x-wiki
<includeonly>{{safesubst<noinclude />:#ifeq: {{Yesno-no|{{{noredlink|}}}}}|yes<noinclude><!--
--></noinclude>|<noinclude><!--
#Check for existence of Template: Country data foo before invoking it
--></noinclude>{{safesubst<noinclude />:#ifexist: Template: Country data {{{1|}}}<noinclude><!--
--></noinclude>|<noinclude><!--
# It exists, so proceed
--></noinclude>{{country data {{{1|}}}|flagicon/core|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude><!--
--></noinclude>|<noinclude><!--
# It doesn't exist, so do nothing
--></noinclude>}}<noinclude><!--
--></noinclude>|<noinclude><!--
# DEFAULT call Template: Country data {{{1|}}}
# with no prior checks
--></noinclude>{{country data {{{1|}}}|flagicon/core|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude><!--
# Track use where "Template:Country data Foo" does not exist
--></noinclude>{{safesubst<noinclude />:#ifexist: Template:Country data {{{1|}}}||{{safesubst<noinclude />:namespace detect showall
| 1 =
| 2 = [[Category:Flagicons with missing country data templates]]
| user = 1
| talk = 1
| other = 2
}}}}<noinclude><!--
--></noinclude>}}</includeonly>{{safesubst<noinclude />:#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using flagicon template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Flagicon]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | noredlink | size | variant }}<noinclude>
{{Documentation}}
</noinclude>
4ba00e607bb28194908c631e424736dd64374684
Template:Flagicon/core
10
71
147
2023-11-02T18:21:55Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Flagicon/core]]
wikitext
text/x-wiki
<span class="flagicon">[[File:{{{flag alias-{{{variant}}}|{{safesubst<noinclude />:#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{safesubst<noinclude />:#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{safesubst<noinclude />:#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt={{{alias}}}|link={{{alias}}}]]</span><noinclude>{{documentation}}</noinclude>
14677aa18a0f6a866112637a51ba28adf4dd4bbe
Template:Flagicon image
10
75
155
2023-11-02T18:21:55Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Flagicon_image]]
wikitext
text/x-wiki
<span class="flagicon">[[File:{{#if:{{{1|}}}|{{{1}}}|Flag placeholder.svg}}|{{{size|23x15px}}}|{{{border|{{#if:{{{1|}}}|border}}}}} |alt=|link={{{link|}}}]]</span><noinclude>{{documentation}}</noinclude>
057d0b94a9367359ad010c3da1fcdcb1e880dcb5
Module:Coordinates
828
93
191
2023-11-02T18:21:56Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Coordinates]]
Scribunto
text/plain
--[[
This module is intended to replace the functionality of {{Coord}} and related
templates. It provides several methods, including
{{#invoke:Coordinates | coord }} : General function formatting and displaying
coordinate values.
{{#invoke:Coordinates | dec2dms }} : Simple function for converting decimal
degree values to DMS format.
{{#invoke:Coordinates | dms2dec }} : Simple function for converting DMS format
to decimal degree format.
{{#invoke:Coordinates | link }} : Export the link used to reach the tools
]]
require('strict')
local math_mod = require("Module:Math")
local coordinates = {};
local isSandbox = mw.getCurrentFrame():getTitle():find('sandbox', 1, true);
local current_page = mw.title.getCurrentTitle()
local page_name = mw.uri.encode( current_page.prefixedText, 'WIKI' );
local coord_link = 'https://geohack.toolforge.org/geohack.php?pagename=' .. page_name .. '¶ms='
--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(coords)
return mw.getCurrentFrame():extensionTag{
name = 'indicator',
args = { name = 'coordinates' },
content = '<span id="coordinates">[[Geographic coordinate system|Coordinates]]: ' .. coords .. '</span>'
}
end
--[[ Helper function, used in detecting DMS formatting ]]
local function dmsTest(first, second)
if type(first) ~= 'string' or type(second) ~= 'string' then
return nil
end
local s = (first .. second):upper()
return s:find('^[NS][EW]$') or s:find('^[EW][NS]$')
end
--[[ Wrapper function to grab args, see Module:Arguments for this function's documentation. ]]
local function makeInvokeFunc(funcName)
return function (frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Coord'
})
return coordinates[funcName](args, frame)
end
end
--[[ Helper function, handle optional args. ]]
local function optionalArg(arg, supplement)
return arg and arg .. supplement or ''
end
--[[
Formats any error messages generated for display
]]
local function errorPrinter(errors)
local result = ""
for i,v in ipairs(errors) do
result = result .. '<strong class="error">Coordinates: ' .. v[2] .. '</strong><br />'
end
return result
end
--[[
Determine the required CSS class to display coordinates
Usually geo-nondefault is hidden by CSS, unless a user has overridden this for himself
default is the mode as specificied by the user when calling the {{coord}} template
mode is the display mode (dec or dms) that we will need to determine the css class for
]]
local function displayDefault(default, mode)
if default == "" then
default = "dec"
end
if default == mode then
return "geo-default"
else
return "geo-nondefault"
end
end
--[[
specPrinter
Output formatter. Takes the structure generated by either parseDec
or parseDMS and formats it for inclusion on Wikipedia.
]]
local function specPrinter(args, coordinateSpec)
local uriComponents = coordinateSpec["param"]
if uriComponents == "" then
-- RETURN error, should never be empty or nil
return "ERROR param was empty"
end
if args["name"] then
uriComponents = uriComponents .. "&title=" .. mw.uri.encode(coordinateSpec["name"])
end
local geodmshtml = '<span class="geo-dms" title="Maps, aerial photos, and other data for this location">'
.. '<span class="latitude">' .. coordinateSpec["dms-lat"] .. '</span> '
.. '<span class="longitude">' ..coordinateSpec["dms-long"] .. '</span>'
.. '</span>'
local lat = tonumber( coordinateSpec["dec-lat"] ) or 0
local geodeclat
if lat < 0 then
-- FIXME this breaks the pre-existing precision
geodeclat = tostring(coordinateSpec["dec-lat"]):sub(2) .. "ยฐS"
else
geodeclat = (coordinateSpec["dec-lat"] or 0) .. "ยฐN"
end
local long = tonumber( coordinateSpec["dec-long"] ) or 0
local geodeclong
if long < 0 then
-- FIXME does not handle unicode minus
geodeclong = tostring(coordinateSpec["dec-long"]):sub(2) .. "ยฐW"
else
geodeclong = (coordinateSpec["dec-long"] or 0) .. "ยฐE"
end
local geodechtml = '<span class="geo-dec" title="Maps, aerial photos, and other data for this location">'
.. geodeclat .. ' '
.. geodeclong
.. '</span>'
local geonumhtml = '<span class="geo">'
.. coordinateSpec["dec-lat"] .. '; '
.. coordinateSpec["dec-long"]
.. '</span>'
local inner = '<span class="' .. displayDefault(coordinateSpec["default"], "dms" ) .. '">' .. geodmshtml .. '</span>'
.. '<span class="geo-multi-punct"> / </span>'
.. '<span class="' .. displayDefault(coordinateSpec["default"], "dec" ) .. '">';
if not args["name"] then
inner = inner .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span></span>'
else
inner = inner .. '<span class="vcard">' .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span>'
.. '<span style="display:none"> (<span class="fn org">'
.. args["name"] .. '</span>)</span></span></span>'
end
local stylesheetLink = 'Module:Coordinates' .. ( isSandbox and '/sandbox' or '' ) .. '/styles.css'
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = stylesheetLink }
} .. '<span class="plainlinks nourlexpansion">[' .. coord_link .. uriComponents ..
' ' .. inner .. ']</span>'
end
--[[ Helper function, convert decimal to degrees ]]
local function convert_dec2dms_d(coordinate)
local d = math_mod._round( coordinate, 0 ) .. "ยฐ"
return d .. ""
end
--[[ Helper function, convert decimal to degrees and minutes ]]
local function convert_dec2dms_dm(coordinate)
coordinate = math_mod._round( coordinate * 60, 0 );
local m = coordinate % 60;
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."ยฐ"
return d .. string.format( "%02dโฒ", m )
end
--[[ Helper function, convert decimal to degrees, minutes, and seconds ]]
local function convert_dec2dms_dms(coordinate)
coordinate = math_mod._round( coordinate * 60 * 60, 0 );
local s = coordinate % 60
coordinate = math.floor( (coordinate - s) / 60 );
local m = coordinate % 60
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."ยฐ"
return d .. string.format( "%02dโฒ", m ) .. string.format( "%02dโณ", s )
end
--[[
Helper function, convert decimal latitude or longitude to
degrees, minutes, and seconds format based on the specified precision.
]]
local function convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
local coord = tonumber(coordinate)
local postfix
if coord >= 0 then
postfix = firstPostfix
else
postfix = secondPostfix
end
precision = precision:lower();
if precision == "dms" then
return convert_dec2dms_dms( math.abs( coord ) ) .. postfix;
elseif precision == "dm" then
return convert_dec2dms_dm( math.abs( coord ) ) .. postfix;
elseif precision == "d" then
return convert_dec2dms_d( math.abs( coord ) ) .. postfix;
end
end
--[[
Convert DMS format into a N or E decimal coordinate
]]
local function convert_dms2dec(direction, degrees_str, minutes_str, seconds_str)
local degrees = tonumber(degrees_str)
local minutes = tonumber(minutes_str) or 0
local seconds = tonumber(seconds_str) or 0
local factor = 1
if direction == "S" or direction == "W" then
factor = -1
end
local precision = 0
if seconds_str then
precision = 5 + math.max( math_mod._precision(seconds_str), 0 );
elseif minutes_str and minutes_str ~= '' then
precision = 3 + math.max( math_mod._precision(minutes_str), 0 );
else
precision = math.max( math_mod._precision(degrees_str), 0 );
end
local decimal = factor * (degrees+(minutes+seconds/60)/60)
return string.format( "%." .. precision .. "f", decimal ) -- not tonumber since this whole thing is string based.
end
--[[
Checks input values to for out of range errors.
]]
local function validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, source, strong )
local errors = {};
lat_d = tonumber( lat_d ) or 0;
lat_m = tonumber( lat_m ) or 0;
lat_s = tonumber( lat_s ) or 0;
long_d = tonumber( long_d ) or 0;
long_m = tonumber( long_m ) or 0;
long_s = tonumber( long_s ) or 0;
if strong then
if lat_d < 0 then
table.insert(errors, {source, "latitude degrees < 0 with hemisphere flag"})
end
if long_d < 0 then
table.insert(errors, {source, "longitude degrees < 0 with hemisphere flag"})
end
--[[
#coordinates is inconsistent about whether this is an error. If globe: is
specified, it won't error on this condition, but otherwise it will.
For not simply disable this check.
if long_d > 180 then
table.insert(errors, {source, "longitude degrees > 180 with hemisphere flag"})
end
]]
end
if lat_d > 90 then
table.insert(errors, {source, "latitude degrees > 90"})
end
if lat_d < -90 then
table.insert(errors, {source, "latitude degrees < -90"})
end
if lat_m >= 60 then
table.insert(errors, {source, "latitude minutes >= 60"})
end
if lat_m < 0 then
table.insert(errors, {source, "latitude minutes < 0"})
end
if lat_s >= 60 then
table.insert(errors, {source, "latitude seconds >= 60"})
end
if lat_s < 0 then
table.insert(errors, {source, "latitude seconds < 0"})
end
if long_d >= 360 then
table.insert(errors, {source, "longitude degrees >= 360"})
end
if long_d <= -360 then
table.insert(errors, {source, "longitude degrees <= -360"})
end
if long_m >= 60 then
table.insert(errors, {source, "longitude minutes >= 60"})
end
if long_m < 0 then
table.insert(errors, {source, "longitude minutes < 0"})
end
if long_s >= 60 then
table.insert(errors, {source, "longitude seconds >= 60"})
end
if long_s < 0 then
table.insert(errors, {source, "longitude seconds < 0"})
end
return errors;
end
--[[
parseDec
Transforms decimal format latitude and longitude into the
structure to be used in displaying coordinates
]]
local function parseDec( lat, long, format )
local coordinateSpec = {}
local errors = {}
if not long then
return nil, {{"parseDec", "Missing longitude"}}
elseif not tonumber(long) then
return nil, {{"parseDec", "Longitude could not be parsed as a number: " .. long}}
end
errors = validate( lat, nil, nil, long, nil, nil, 'parseDec', false );
coordinateSpec["dec-lat"] = lat;
coordinateSpec["dec-long"] = long;
local mode = coordinates.determineMode( lat, long );
coordinateSpec["dms-lat"] = convert_dec2dms( lat, "N", "S", mode) -- {{coord/dec2dms|{{{1}}}|N|S|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
coordinateSpec["dms-long"] = convert_dec2dms( long, "E", "W", mode) -- {{coord/dec2dms|{{{2}}}|E|W|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dec"
end
return coordinateSpec, errors
end
--[[
parseDMS
Transforms degrees, minutes, seconds format latitude and longitude
into the a structure to be used in displaying coordinates
]]
local function parseDMS( lat_d, lat_m, lat_s, lat_f, long_d, long_m, long_s, long_f, format )
local coordinateSpec, errors, backward = {}, {}
lat_f = lat_f:upper();
long_f = long_f:upper();
-- Check if specified backward
if lat_f == 'E' or lat_f == 'W' then
lat_d, long_d, lat_m, long_m, lat_s, long_s, lat_f, long_f, backward = long_d, lat_d, long_m, lat_m, long_s, lat_s, long_f, lat_f, true;
end
errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true );
if not long_d then
return nil, {{"parseDMS", "Missing longitude" }}
elseif not tonumber(long_d) then
return nil, {{"parseDMS", "Longitude could not be parsed as a number:" .. long_d }}
end
if not lat_m and not lat_s and not long_m and not long_s and #errors == 0 then
if math_mod._precision( lat_d ) > 0 or math_mod._precision( long_d ) > 0 then
if lat_f:upper() == 'S' then
lat_d = '-' .. lat_d;
end
if long_f:upper() == 'W' then
long_d = '-' .. long_d;
end
return parseDec( lat_d, long_d, format );
end
end
coordinateSpec["dms-lat"] = lat_d.."ยฐ"..optionalArg(lat_m,"โฒ") .. optionalArg(lat_s,"โณ") .. lat_f
coordinateSpec["dms-long"] = long_d.."ยฐ"..optionalArg(long_m,"โฒ") .. optionalArg(long_s,"โณ") .. long_f
coordinateSpec["dec-lat"] = convert_dms2dec(lat_f, lat_d, lat_m, lat_s) -- {{coord/dms2dec|{{{4}}}|{{{1}}}|0{{{2}}}|0{{{3}}}}}
coordinateSpec["dec-long"] = convert_dms2dec(long_f, long_d, long_m, long_s) -- {{coord/dms2dec|{{{8}}}|{{{5}}}|0{{{6}}}|0{{{7}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dms"
end
return coordinateSpec, errors, backward
end
--[[
Check the input arguments for coord to determine the kind of data being provided
and then make the necessary processing.
]]
local function formatTest(args)
local result, errors
local backward, primary = false, false
local function getParam(args, lim)
local ret = {}
for i = 1, lim do
ret[i] = args[i] or ''
end
return table.concat(ret, '_')
end
if not args[1] then
-- no lat logic
return errorPrinter( {{"formatTest", "Missing latitude"}} )
elseif not tonumber(args[1]) then
-- bad lat logic
return errorPrinter( {{"formatTest", "Unable to parse latitude as a number:" .. args[1]}} )
elseif not args[4] and not args[5] and not args[6] then
-- dec logic
result, errors = parseDec(args[1], args[2], args.format)
if not result then
return errorPrinter(errors);
end
-- formatting for geohack: geohack expects D_N_D_E notation or D;D notation
-- wikiminiatlas doesn't support D;D notation
-- #coordinates parserfunction doesn't support negative decimals with NSWE
result.param = table.concat({
math.abs(tonumber(args[1])),
((tonumber(args[1]) or 0) < 0) and 'S' or 'N',
math.abs(tonumber(args[2])),
((tonumber(args[2]) or 0) < 0) and 'W' or 'E',
args[3] or ''}, '_')
elseif dmsTest(args[4], args[8]) then
-- dms logic
result, errors, backward = parseDMS(args[1], args[2], args[3], args[4],
args[5], args[6], args[7], args[8], args.format)
if args[10] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 9)
elseif dmsTest(args[3], args[6]) then
-- dm logic
result, errors, backward = parseDMS(args[1], args[2], nil, args[3],
args[4], args[5], nil, args[6], args['format'])
if args[8] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 7)
elseif dmsTest(args[2], args[4]) then
-- d logic
result, errors, backward = parseDMS(args[1], nil, nil, args[2],
args[3], nil, nil, args[4], args.format)
if args[6] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 5)
else
-- Error
return errorPrinter({{"formatTest", "Unknown argument format"}}) .. '[[Category:Pages with malformed coordinate tags]]'
end
result.name = args.name
local extra_param = {'dim', 'globe', 'scale', 'region', 'source', 'type'}
for _, v in ipairs(extra_param) do
if args[v] then
table.insert(errors, {'formatTest', 'Parameter: "' .. v .. '=" should be "' .. v .. ':"' })
end
end
local ret = specPrinter(args, result)
if #errors > 0 then
ret = ret .. ' ' .. errorPrinter(errors) .. '[[Category:Pages with malformed coordinate tags]]'
end
return ret, backward
end
--[[
Generate Wikidata tracking categories.
]]
local function makeWikidataCategories(qid)
local ret
local qid = qid or mw.wikibase.getEntityIdForCurrentPage()
if mw.wikibase and current_page.namespace == 0 then
if qid and mw.wikibase.entityExists(qid) and mw.wikibase.getBestStatements(qid, "P625") and mw.wikibase.getBestStatements(qid, "P625")[1] then
local snaktype = mw.wikibase.getBestStatements(qid, "P625")[1].mainsnak.snaktype
if snaktype == 'value' then
-- coordinates exist both here and on Wikidata, and can be compared.
ret = 'Coordinates on Wikidata'
elseif snaktype == 'somevalue' then
ret = 'Coordinates on Wikidata set to unknown value'
elseif snaktype == 'novalue' then
ret = 'Coordinates on Wikidata set to no value'
end
else
-- We have to either import the coordinates to Wikidata or remove them here.
ret = 'Coordinates not on Wikidata'
end
end
if ret then
return string.format('[[Category:%s]]', ret)
else
return ''
end
end
--[[
link
Simple function to export the coordinates link for other uses.
Usage:
{{#invoke:Coordinates | link }}
]]
function coordinates.link(frame)
return coord_link;
end
--[[
dec2dms
Wrapper to allow templates to call dec2dms directly.
Usage:
{{#invoke:Coordinates | dec2dms | decimal_coordinate | positive_suffix |
negative_suffix | precision }}
decimal_coordinate is converted to DMS format. If positive, the positive_suffix
is appended (typical N or E), if negative, the negative suffix is appended. The
specified precision is one of 'D', 'DM', or 'DMS' to specify the level of detail
to use.
]]
coordinates.dec2dms = makeInvokeFunc('_dec2dms')
function coordinates._dec2dms(args)
local coordinate = args[1]
local firstPostfix = args[2] or ''
local secondPostfix = args[3] or ''
local precision = args[4] or ''
return convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
end
--[[
Helper function to determine whether to use D, DM, or DMS
format depending on the precision of the decimal input.
]]
function coordinates.determineMode( value1, value2 )
local precision = math.max( math_mod._precision( value1 ), math_mod._precision( value2 ) );
if precision <= 0 then
return 'd'
elseif precision <= 2 then
return 'dm';
else
return 'dms';
end
end
--[[
dms2dec
Wrapper to allow templates to call dms2dec directly.
Usage:
{{#invoke:Coordinates | dms2dec | direction_flag | degrees |
minutes | seconds }}
Converts DMS values specified as degrees, minutes, seconds too decimal format.
direction_flag is one of N, S, E, W, and determines whether the output is
positive (i.e. N and E) or negative (i.e. S and W).
]]
coordinates.dms2dec = makeInvokeFunc('_dms2dec')
function coordinates._dms2dec(args)
local direction = args[1]
local degrees = args[2]
local minutes = args[3]
local seconds = args[4]
return convert_dms2dec(direction, degrees, minutes, seconds)
end
--[[
coord
Main entry point for Lua function to replace {{coord}}
Usage:
{{#invoke:Coordinates | coord }}
{{#invoke:Coordinates | coord | lat | long }}
{{#invoke:Coordinates | coord | lat | lat_flag | long | long_flag }}
...
Refer to {{coord}} documentation page for many additional parameters and
configuration options.
Note: This function provides the visual display elements of {{coord}}. In
order to load coordinates into the database, the {{#coordinates:}} parser
function must also be called, this is done automatically in the Lua
version of {{coord}}.
]]
coordinates.coord = makeInvokeFunc('_coord')
function coordinates._coord(args)
if not tonumber(args[1]) and not args[2] then
args[3] = args[1]; args[1] = nil
local entity = mw.wikibase.getEntityObject(args.qid)
if entity
and entity.claims
and entity.claims.P625
and entity.claims.P625[1].mainsnak.snaktype == 'value'
then
local precision = entity.claims.P625[1].mainsnak.datavalue.value.precision
args[1] = entity.claims.P625[1].mainsnak.datavalue.value.latitude
args[2] = entity.claims.P625[1].mainsnak.datavalue.value.longitude
if precision then
precision = -math_mod._round(math.log(precision)/math.log(10),0)
args[1] = math_mod._round(args[1],precision)
args[2] = math_mod._round(args[2],precision)
end
end
end
local contents, backward = formatTest(args)
local Notes = args.notes or ''
local Display = args.display and args.display:lower() or 'inline'
-- it and ti are short for inline,title and title,inline
local function isInline(s)
-- Finds whether coordinates are displayed inline.
return s:find('inline') ~= nil or s == 'i' or s == 'it' or s == 'ti'
end
local function isInTitle(s)
-- Finds whether coordinates are displayed in the title.
return s:find('title') ~= nil or s == 't' or s == 'it' or s == 'ti'
end
local function coord_wrapper(in_args)
-- Calls the parser function {{#coordinates:}}.
return mw.getCurrentFrame():callParserFunction('#coordinates', in_args) or ''
end
local text = ''
if isInline(Display) then
text = text .. '<span class="geo-inline">' .. contents .. Notes .. '</span>'
end
if isInTitle(Display) then
-- Add to output since indicator content is invisible to Lua later on
if not isInline(Display) then
text = text .. '<span class="geo-inline-hidden noexcerpt">' .. contents .. Notes .. '</span>'
end
text = text .. displaytitle(contents .. Notes) .. makeWikidataCategories(args.qid)
end
if not args.nosave then
local page_title, count = mw.title.getCurrentTitle(), 1
if backward then
local tmp = {}
while not string.find((args[count-1] or ''), '[EW]') do tmp[count] = (args[count] or ''); count = count+1 end
tmp.count = count; count = 2*(count-1)
while count >= tmp.count do table.insert(tmp, 1, (args[count] or '')); count = count-1 end
for i, v in ipairs(tmp) do args[i] = v end
else
while count <= 9 do args[count] = (args[count] or ''); count = count+1 end
end
if isInTitle(Display) and not page_title.isTalkPage and page_title.subpageText ~= 'doc' and page_title.subpageText ~= 'testcases' then args[10] = 'primary' end
args.notes, args.format, args.display = nil
text = text .. coord_wrapper(args)
end
return text
end
--[[
coord2text
Extracts a single value from a transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coord2text | {{Coord}} | parameter }}
Valid values for the second parameter are: lat (signed integer), long (signed integer), type, scale, dim, region, globe, source
]]
function coordinates._coord2text(coord,type)
if coord == '' or type == '' or not type then return nil end
type = mw.text.trim(type)
if type == 'lat' or type == 'long' then
local result, negative = mw.text.split((mw.ustring.match(coord,'[%.%d]+ยฐ[NS] [%.%d]+ยฐ[EW]') or ''), ' ')
if type == 'lat' then
result, negative = result[1], 'S'
else
result, negative = result[2], 'W'
end
result = mw.text.split(result, 'ยฐ')
if result[2] == negative then result[1] = '-'..result[1] end
return result[1]
else
return mw.ustring.match(coord, 'params=.-_' .. type .. ':(.-)[ _]')
end
end
function coordinates.coord2text(frame)
return coordinates._coord2text(frame.args[1],frame.args[2])
end
--[[
coordinsert
Injects some text into the Geohack link of a transclusion of {{Coord}} (if that text isn't already in the transclusion). Outputs the modified transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coordinsert | {{Coord}} | parameter:value | parameter:value | โฆ }}
Do not make Geohack unhappy by inserting something which isn't mentioned in the {{Coord}} documentation.
]]
function coordinates.coordinsert(frame)
-- for the 2nd or later integer parameter (the first is the coord template, as above)
for i, v in ipairs(frame.args) do
if i ~= 1 then
-- if we cannot find in the coord_template the i_th coordinsert parameter e.g. region
if not mw.ustring.find(frame.args[1], (mw.ustring.match(frame.args[i], '^(.-:)') or '')) then
-- find from the params= up to the first possibly-present underscore
-- and append the i_th coordinsert parameter and a space
-- IDK why we're adding a space but it does seem somewhat convenient
frame.args[1] = mw.ustring.gsub(frame.args[1], '(params=.-)_? ', '%1_'..frame.args[i]..' ')
end
end
end
if frame.args.name then
-- if we can't find the vcard class
if not mw.ustring.find(frame.args[1], '<span class="vcard">') then
-- take something that looks like a coord template and add the vcard span with class and fn org class
local namestr = frame.args.name
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(<span class="geo%-default">)(<span[^<>]*>[^<>]*</span><span[^<>]*>[^<>]*<span[^<>]*>[^<>]*</span></span>)(</span>)',
'%1<span class="vcard">%2<span style="display:none"> (<span class="fn org">' .. namestr .. '</span>)</span></span>%3'
)
-- then find anything from coordinates parameters to the 'end' and attach the title parameter
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(¶ms=[^&"<>%[%] ]*) ',
'%1&title=' .. mw.uri.encode(namestr) .. ' '
)
end
end
-- replace the existing indicator with a new indicator using the modified content
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(<span class="geo%-inline[^"]*">(.+)</span>)\127[^\127]*UNIQ%-%-indicator%-%x+%-%-?QINU[^\127]*\127',
function (inline, coord) return inline .. displaytitle(coord) end
)
return frame.args[1]
end
return coordinates
6162d7e98fcf6faab5809049e0a48bb3e67d88e3
Module:Math
828
94
193
2023-11-02T18:21:57Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Math]]
Scribunto
text/plain
--[[
This module provides a number of basic mathematical operations.
]]
local yesno, getArgs -- lazily initialized
local p = {} -- Holds functions to be returned from #invoke, and functions to make available to other Lua modules.
local wrap = {} -- Holds wrapper functions that process arguments from #invoke. These act as intemediary between functions meant for #invoke and functions meant for Lua.
--[[
Helper functions used to avoid redundant code.
]]
local function err(msg)
-- Generates wikitext error messages.
return mw.ustring.format('<strong class="error">Formatting error: %s</strong>', msg)
end
local function unpackNumberArgs(args)
-- Returns an unpacked list of arguments specified with numerical keys.
local ret = {}
for k, v in pairs(args) do
if type(k) == 'number' then
table.insert(ret, v)
end
end
return unpack(ret)
end
local function makeArgArray(...)
-- Makes an array of arguments from a list of arguments that might include nils.
local args = {...} -- Table of arguments. It might contain nils or non-number values, so we can't use ipairs.
local nums = {} -- Stores the numbers of valid numerical arguments.
local ret = {}
for k, v in pairs(args) do
v = p._cleanNumber(v)
if v then
nums[#nums + 1] = k
args[k] = v
end
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[#ret + 1] = args[num]
end
return ret
end
local function fold(func, ...)
-- Use a function on all supplied arguments, and return the result. The function must accept two numbers as parameters,
-- and must return a number as an output. This number is then supplied as input to the next function call.
local vals = makeArgArray(...)
local count = #vals -- The number of valid arguments
if count == 0 then return
-- Exit if we have no valid args, otherwise removing the first arg would cause an error.
nil, 0
end
local ret = table.remove(vals, 1)
for _, val in ipairs(vals) do
ret = func(ret, val)
end
return ret, count
end
--[[
Fold arguments by selectively choosing values (func should return when to choose the current "dominant" value).
]]
local function binary_fold(func, ...)
local value = fold((function(a, b) if func(a, b) then return a else return b end end), ...)
return value
end
--[[
random
Generate a random number
Usage:
{{#invoke: Math | random }}
{{#invoke: Math | random | maximum value }}
{{#invoke: Math | random | minimum value | maximum value }}
]]
function wrap.random(args)
local first = p._cleanNumber(args[1])
local second = p._cleanNumber(args[2])
return p._random(first, second)
end
function p._random(first, second)
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))
-- math.random will throw an error if given an explicit nil parameter, so we need to use if statements to check the params.
if first and second then
if first <= second then -- math.random doesn't allow the first number to be greater than the second.
return math.random(first, second)
end
elseif first then
return math.random(first)
else
return math.random()
end
end
--[[
order
Determine order of magnitude of a number
Usage:
{{#invoke: Math | order | value }}
]]
function wrap.order(args)
local input_string = (args[1] or args.x or '0');
local input_number = p._cleanNumber(input_string);
if input_number == nil then
return err('order of magnitude input appears non-numeric')
else
return p._order(input_number)
end
end
function p._order(x)
if x == 0 then return 0 end
return math.floor(math.log10(math.abs(x)))
end
--[[
precision
Detemines the precision of a number using the string representation
Usage:
{{ #invoke: Math | precision | value }}
]]
function wrap.precision(args)
local input_string = (args[1] or args.x or '0');
local trap_fraction = args.check_fraction;
local input_number;
if not yesno then
yesno = require('Module:Yesno')
end
if yesno(trap_fraction, true) then -- Returns true for all input except nil, false, "no", "n", "0" and a few others. See [[Module:Yesno]].
local pos = string.find(input_string, '/', 1, true);
if pos ~= nil then
if string.find(input_string, '/', pos + 1, true) == nil then
local denominator = string.sub(input_string, pos+1, -1);
local denom_value = tonumber(denominator);
if denom_value ~= nil then
return math.log10(denom_value);
end
end
end
end
input_number, input_string = p._cleanNumber(input_string);
if input_string == nil then
return err('precision input appears non-numeric')
else
return p._precision(input_string)
end
end
function p._precision(x)
if type(x) == 'number' then
x = tostring(x)
end
x = string.upper(x)
local decimal = x:find('%.')
local exponent_pos = x:find('E')
local result = 0;
if exponent_pos ~= nil then
local exponent = string.sub(x, exponent_pos + 1)
x = string.sub(x, 1, exponent_pos - 1)
result = result - tonumber(exponent)
end
if decimal ~= nil then
result = result + string.len(x) - decimal
return result
end
local pos = string.len(x);
while x:byte(pos) == string.byte('0') do
pos = pos - 1
result = result - 1
if pos <= 0 then
return 0
end
end
return result
end
--[[
max
Finds the maximum argument
Usage:
{{#invoke:Math| max | value1 | value2 | ... }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.max(args)
return p._max(unpackNumberArgs(args))
end
function p._max(...)
local max_value = binary_fold((function(a, b) return a > b end), ...)
if max_value then
return max_value
end
end
--[[
median
Find the median of set of numbers
Usage:
{{#invoke:Math | median | number1 | number2 | ...}}
OR
{{#invoke:Math | median }}
]]
function wrap.median(args)
return p._median(unpackNumberArgs(args))
end
function p._median(...)
local vals = makeArgArray(...)
local count = #vals
table.sort(vals)
if count == 0 then
return 0
end
if p._mod(count, 2) == 0 then
return (vals[count/2] + vals[count/2+1])/2
else
return vals[math.ceil(count/2)]
end
end
--[[
min
Finds the minimum argument
Usage:
{{#invoke:Math| min | value1 | value2 | ... }}
OR
{{#invoke:Math| min }}
When used with no arguments, it takes its input from the parent
frame. Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.min(args)
return p._min(unpackNumberArgs(args))
end
function p._min(...)
local min_value = binary_fold((function(a, b) return a < b end), ...)
if min_value then
return min_value
end
end
--[[
sum
Finds the sum
Usage:
{{#invoke:Math| sum | value1 | value2 | ... }}
OR
{{#invoke:Math| sum }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.sum(args)
return p._sum(unpackNumberArgs(args))
end
function p._sum(...)
local sums, count = fold((function(a, b) return a + b end), ...)
if not sums then
return 0
else
return sums
end
end
--[[
average
Finds the average
Usage:
{{#invoke:Math| average | value1 | value2 | ... }}
OR
{{#invoke:Math| average }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.average(args)
return p._average(unpackNumberArgs(args))
end
function p._average(...)
local sum, count = fold((function(a, b) return a + b end), ...)
if not sum then
return 0
else
return sum / count
end
end
--[[
round
Rounds a number to specified precision
Usage:
{{#invoke:Math | round | value | precision }}
--]]
function wrap.round(args)
local value = p._cleanNumber(args[1] or args.value or 0)
local precision = p._cleanNumber(args[2] or args.precision or 0)
if value == nil or precision == nil then
return err('round input appears non-numeric')
else
return p._round(value, precision)
end
end
function p._round(value, precision)
local rescale = math.pow(10, precision or 0);
return math.floor(value * rescale + 0.5) / rescale;
end
--[[
log10
returns the log (base 10) of a number
Usage:
{{#invoke:Math | log10 | x }}
]]
function wrap.log10(args)
return math.log10(args[1])
end
--[[
mod
Implements the modulo operator
Usage:
{{#invoke:Math | mod | x | y }}
--]]
function wrap.mod(args)
local x = p._cleanNumber(args[1])
local y = p._cleanNumber(args[2])
if not x then
return err('first argument to mod appears non-numeric')
elseif not y then
return err('second argument to mod appears non-numeric')
else
return p._mod(x, y)
end
end
function p._mod(x, y)
local ret = x % y
if not (0 <= ret and ret < y) then
ret = 0
end
return ret
end
--[[
gcd
Calculates the greatest common divisor of multiple numbers
Usage:
{{#invoke:Math | gcd | value 1 | value 2 | value 3 | ... }}
--]]
function wrap.gcd(args)
return p._gcd(unpackNumberArgs(args))
end
function p._gcd(...)
local function findGcd(a, b)
local r = b
local oldr = a
while r ~= 0 do
local quotient = math.floor(oldr / r)
oldr, r = r, oldr - quotient * r
end
if oldr < 0 then
oldr = oldr * -1
end
return oldr
end
local result, count = fold(findGcd, ...)
return result
end
--[[
precision_format
Rounds a number to the specified precision and formats according to rules
originally used for {{template:Rnd}}. Output is a string.
Usage:
{{#invoke: Math | precision_format | number | precision }}
]]
function wrap.precision_format(args)
local value_string = args[1] or 0
local precision = args[2] or 0
return p._precision_format(value_string, precision)
end
function p._precision_format(value_string, precision)
-- For access to Mediawiki built-in formatter.
local lang = mw.getContentLanguage();
local value
value, value_string = p._cleanNumber(value_string)
precision = p._cleanNumber(precision)
-- Check for non-numeric input
if value == nil or precision == nil then
return err('invalid input when rounding')
end
local current_precision = p._precision(value)
local order = p._order(value)
-- Due to round-off effects it is neccesary to limit the returned precision under
-- some circumstances because the terminal digits will be inaccurately reported.
if order + precision >= 14 then
if order + p._precision(value_string) >= 14 then
precision = 13 - order;
end
end
-- If rounding off, truncate extra digits
if precision < current_precision then
value = p._round(value, precision)
current_precision = p._precision(value)
end
local formatted_num = lang:formatNum(math.abs(value))
local sign
-- Use proper unary minus sign rather than ASCII default
if value < 0 then
sign = 'โ'
else
sign = ''
end
-- Handle cases requiring scientific notation
if string.find(formatted_num, 'E', 1, true) ~= nil or math.abs(order) >= 9 then
value = value * math.pow(10, -order)
current_precision = current_precision + order
precision = precision + order
formatted_num = lang:formatNum(math.abs(value))
else
order = 0;
end
formatted_num = sign .. formatted_num
-- Pad with zeros, if needed
if current_precision < precision then
local padding
if current_precision <= 0 then
if precision > 0 then
local zero_sep = lang:formatNum(1.1)
formatted_num = formatted_num .. zero_sep:sub(2,2)
padding = precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
else
padding = precision - current_precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
end
-- Add exponential notation, if necessary.
if order ~= 0 then
-- Use proper unary minus sign rather than ASCII default
if order < 0 then
order = 'โ' .. lang:formatNum(math.abs(order))
else
order = lang:formatNum(order)
end
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">ร</span>10<sup>' .. order .. '</sup>'
end
return formatted_num
end
--[[
divide
Implements the division operator
Usage:
{{#invoke:Math | divide | x | y | round= | precision= }}
--]]
function wrap.divide(args)
local x = args[1]
local y = args[2]
local round = args.round
local precision = args.precision
if not yesno then
yesno = require('Module:Yesno')
end
return p._divide(x, y, yesno(round), precision)
end
function p._divide(x, y, round, precision)
if y == nil or y == "" then
return err("Empty divisor")
elseif not tonumber(y) then
if type(y) == 'string' and string.sub(y, 1, 1) == '<' then
return y
else
return err("Not a number: " .. y)
end
elseif x == nil or x == "" then
return err("Empty dividend")
elseif not tonumber(x) then
if type(x) == 'string' and string.sub(x, 1, 1) == '<' then
return x
else
return err("Not a number: " .. x)
end
else
local z = x / y
if round then
return p._round(z, 0)
elseif precision then
return p._round(z, precision)
else
return z
end
end
end
--[[
Helper function that interprets the input numerically. If the
input does not appear to be a number, attempts evaluating it as
a parser functions expression.
]]
function p._cleanNumber(number_string)
if type(number_string) == 'number' then
-- We were passed a number, so we don't need to do any processing.
return number_string, tostring(number_string)
elseif type(number_string) ~= 'string' or not number_string:find('%S') then
-- We were passed a non-string or a blank string, so exit.
return nil, nil;
end
-- Attempt basic conversion
local number = tonumber(number_string)
-- If failed, attempt to evaluate input as an expression
if number == nil then
local success, result = pcall(mw.ext.ParserFunctions.expr, number_string)
if success then
number = tonumber(result)
number_string = tostring(number)
else
number = nil
number_string = nil
end
else
number_string = number_string:match("^%s*(.-)%s*$") -- String is valid but may contain padding, clean it.
number_string = number_string:match("^%+(.*)$") or number_string -- Trim any leading + signs.
if number_string:find('^%-?0[xX]') then
-- Number is using 0xnnn notation to indicate base 16; use the number that Lua detected instead.
number_string = tostring(number)
end
end
return number, number_string
end
--[[
Wrapper function that does basic argument processing. This ensures that all functions from #invoke can use either the current
frame or the parent frame, and it also trims whitespace for all arguments and removes blank arguments.
]]
local mt = { __index = function(t, k)
return function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return wrap[k](getArgs(frame)) -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.
end
end }
return setmetatable(p, mt)
2bbe734d898299f65412963a3c1782e9fcc4d9ca
Module:Location map
828
95
195
2023-11-02T18:21:57Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Location_map]]
Scribunto
text/plain
require('strict')
local p = {}
local getArgs = require('Module:Arguments').getArgs
local function round(n, decimals)
local pow = 10^(decimals or 0)
return math.floor(n * pow + 0.5) / pow
end
function p.getMapParams(map, frame)
if not map then
error('The name of the location map definition to use must be specified', 2)
end
local moduletitle = mw.title.new('Module:Location map/data/' .. map)
if not moduletitle then
error(string.format('%q is not a valid name for a location map definition', map), 2)
elseif moduletitle.exists then
local mapData = mw.loadData('Module:Location map/data/' .. map)
return function(name, params)
if name == nil then
return 'Module:Location map/data/' .. map
elseif mapData[name] == nil then
return ''
elseif params then
return mw.message.newRawMessage(tostring(mapData[name]), unpack(params)):plain()
else
return mapData[name]
end
end
else
error('Unable to find the specified location map definition: "Module:Location map/data/' .. map .. '" does not exist', 2)
end
end
function p.data(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local params = {}
for k,v in ipairs(args) do
if k > 2 then
params[k-2] = v
end
end
return map(args[2], #params ~= 0 and params)
end
local hemisphereMultipliers = {
longitude = { W = -1, w = -1, E = 1, e = 1 },
latitude = { S = -1, s = -1, N = 1, n = 1 }
}
local function decdeg(degrees, minutes, seconds, hemisphere, decimal, direction)
if decimal then
if degrees then
error('Decimal and DMS degrees cannot both be provided for ' .. direction, 2)
elseif minutes then
error('Minutes can only be provided with DMS degrees for ' .. direction, 2)
elseif seconds then
error('Seconds can only be provided with DMS degrees for ' .. direction, 2)
elseif hemisphere then
error('A hemisphere can only be provided with DMS degrees for ' .. direction, 2)
end
local retval = tonumber(decimal)
if retval then
return retval
end
error('The value "' .. decimal .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not minutes then
error('Seconds were provided for ' .. direction .. ' without minutes also being provided', 2)
elseif not degrees then
if minutes then
error('Minutes were provided for ' .. direction .. ' without degrees also being provided', 2)
elseif hemisphere then
error('A hemisphere was provided for ' .. direction .. ' without degrees also being provided', 2)
end
return nil
end
decimal = tonumber(degrees)
if not decimal then
error('The degree value "' .. degrees .. '" provided for ' .. direction .. ' is not valid', 2)
elseif minutes and not tonumber(minutes) then
error('The minute value "' .. minutes .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not tonumber(seconds) then
error('The second value "' .. seconds .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal + (minutes or 0)/60 + (seconds or 0)/3600
if hemisphere then
local multiplier = hemisphereMultipliers[direction][hemisphere]
if not multiplier then
error('The hemisphere "' .. hemisphere .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal * multiplier
end
return decimal
end
-- Finds a parameter in a transclusion of {{Coord}}.
local function coord2text(para,coord) -- this should be changed for languages which do not use Arabic numerals or the degree sign
local lat, long = mw.ustring.match(coord,'<span class="p%-latitude latitude">([^<]+)</span><span class="p%-longitude longitude">([^<]+)</span>')
if lat then
return tonumber(para == 'longitude' and long or lat)
end
local result = mw.text.split(mw.ustring.match(coord,'%-?[%.%d]+ยฐ[NS] %-?[%.%d]+ยฐ[EW]') or '', '[ ยฐ]')
if para == 'longitude' then result = {result[3], result[4]} end
if not tonumber(result[1]) or not result[2] then
mw.log('Malformed coordinates value')
mw.logObject(para, 'para')
mw.logObject(coord, 'coord')
return error('Malformed coordinates value', 2)
end
return tonumber(result[1]) * hemisphereMultipliers[para][result[2]]
end
-- effectively make removeBlanks false for caption and maplink, and true for everything else
-- if useWikidata is present but blank, convert it to false instead of nil
-- p.top, p.bottom, and their callers need to use this
function p.valueFunc(key, value)
if value then
value = mw.text.trim(value)
end
if value ~= '' or key == 'caption' or key == 'maplink' then
return value
elseif key == 'useWikidata' then
return false
end
end
local function getContainerImage(args, map)
if args.AlternativeMap then
return args.AlternativeMap
elseif args.relief then
local digits = mw.ustring.match(args.relief,'^[1-9][0-9]?$') or '1' -- image1 to image99
if map('image' .. digits) ~= '' then
return map('image' .. digits)
end
end
return map('image')
end
function p.top(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local width
local default_as_number = tonumber(mw.ustring.match(tostring(args.default_width),"%d*"))
if not args.width then
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
elseif mw.ustring.sub(args.width, -2) == 'px' then
width = mw.ustring.sub(args.width, 1, -3)
else
width = args.width
end
local width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
if width_as_number == 0 then
-- check to see if width is junk. If it is, then use default calculation
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
end
if args.max_width ~= "" and args.max_width ~= nil then
-- check to see if width bigger than max_width
local max_as_number = tonumber(mw.ustring.match(args.max_width,"%d*")) or 0;
if width_as_number>max_as_number and max_as_number>0 then
width = args.max_width;
end
end
local retval = frame:extensionTag{name = 'templatestyles', args = {src = 'Module:Location map/styles.css'}}
if args.float == 'center' then
retval = retval .. '<div class="center">'
end
if args.caption and args.caption ~= '' and args.border ~= 'infobox' then
retval = retval .. '<div class="locmap noviewer noresize thumb '
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'tleft'
elseif args.float == '"center"' or args.float == 'center' or args.float == '"none"' or args.float == 'none' then
retval = retval .. 'tnone'
else
retval = retval .. 'tright'
end
retval = retval .. '"><div class="thumbinner" style="width:' .. (width + 2) .. 'px'
if args.border == 'none' then
retval = retval .. ';border:none'
elseif args.border then
retval = retval .. ';border-color:' .. args.border
end
retval = retval .. '"><div style="position:relative;width:' .. width .. 'px' .. (args.border ~= 'none' and ';border:1px solid lightgray">' or '">')
else
retval = retval .. '<div class="locmap" style="width:' .. width .. 'px;'
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'float:left;clear:left'
elseif args.float == '"center"' or args.float == 'center' then
retval = retval .. 'float:none;clear:both;margin-left:auto;margin-right:auto'
elseif args.float == '"none"' or args.float == 'none' then
retval = retval .. 'float:none;clear:none'
else
retval = retval .. 'float:right;clear:right'
end
retval = retval .. '"><div style="width:' .. width .. 'px;padding:0"><div style="position:relative;width:' .. width .. 'px">'
end
local image = getContainerImage(args, map)
local currentTitle = mw.title.getCurrentTitle()
retval = string.format(
'%s[[File:%s|%spx|%s%s|class=notpageimage]]',
retval,
image,
width,
args.alt or ((args.label or currentTitle.text) .. ' is located in ' .. map('name')),
args.maplink and ('|link=' .. args.maplink) or ''
)
if args.caption and args.caption ~= '' then
if (currentTitle.namespace == 0) and mw.ustring.find(args.caption, '##') then
retval = retval .. '[[Category:Pages using location map with a double number sign in the caption]]'
end
end
if args.overlay_image then
return retval .. '<div style="position:absolute;top:0;left:0">[[File:' .. args.overlay_image .. '|' .. width .. 'px|class=notpageimage]]</div>'
else
return retval
end
end
function p.bottom(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local retval = '</div>'
local currentTitle = mw.title.getCurrentTitle()
if not args.caption or args.border == 'infobox' then
if args.border then
retval = retval .. '<div style="padding-top:0.2em">'
else
retval = retval .. '<div style="font-size:91%;padding-top:3px">'
end
retval = retval
.. (args.caption or (args.label or currentTitle.text) .. ' (' .. map('name') .. ')')
.. '</div>'
elseif args.caption ~= '' then
-- This is not the pipe trick. We're creating a link with no text on purpose, so that CSS can give us a nice image
retval = retval .. '<div class="thumbcaption"><div class="magnify">[[:File:' .. getContainerImage(args, map) .. '|class=notpageimage| ]]</div>' .. args.caption .. '</div>'
end
if args.switcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">' .. args.switcherLabel .. '</span>'
elseif args.autoSwitcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">Show map of ' .. map('name') .. '</span>'
end
retval = retval .. '</div></div>'
if args.caption_undefined then
mw.log('Removed parameter caption_undefined used.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with removed parameters|caption_undefined]]'
end
end
if map('skew') ~= '' or map('lat_skew') ~= '' or map('crosses180') ~= '' or map('type') ~= '' then
mw.log('Removed parameter used in map definition ' .. map())
if currentTitle.namespace == 0 then
local key = (map('skew') ~= '' and 'skew' or '') ..
(map('lat_skew') ~= '' and 'lat_skew' or '') ..
(map('crosses180') ~= '' and 'crosses180' or '') ..
(map('type') ~= '' and 'type' or '')
retval = retval .. '[[Category:Location maps with removed parameters|' .. key .. ' ]]'
end
end
if string.find(map('name'), '|', 1, true) then
mw.log('Pipe used in name of map definition ' .. map())
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with a name containing a pipe]]'
end
end
if args.float == 'center' then
retval = retval .. '</div>'
end
return retval
end
local function markOuterDiv(x, y, imageDiv, labelDiv)
return mw.html.create('div')
:addClass('od')
:cssText('top:' .. round(y, 3) .. '%;left:' .. round(x, 3) .. '%')
:node(imageDiv)
:node(labelDiv)
end
local function markImageDiv(mark, marksize, label, link, alt, title)
local builder = mw.html.create('div')
:addClass('id')
:cssText('left:-' .. round(marksize / 2) .. 'px;top:-' .. round(marksize / 2) .. 'px')
:attr('title', title)
if marksize ~= 0 then
builder:wikitext(string.format(
'[[File:%s|%dx%dpx|%s|link=%s%s|class=notpageimage]]',
mark,
marksize,
marksize,
label,
link,
alt and ('|alt=' .. alt) or ''
))
end
return builder
end
local function markLabelDiv(label, label_size, label_width, position, background, x, marksize)
if tonumber(label_size) == 0 then
return mw.html.create('div'):addClass('l0'):wikitext(label)
end
local builder = mw.html.create('div')
:cssText('font-size:' .. label_size .. '%;width:' .. label_width .. 'em')
local distance = round(marksize / 2 + 1)
if position == 'top' then -- specified top
builder:addClass('pv'):cssText('bottom:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em')
elseif position == 'bottom' then -- specified bottom
builder:addClass('pv'):cssText('top:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em')
elseif position == 'left' or (tonumber(x) > 70 and position ~= 'right') then -- specified left or autodetected to left
builder:addClass('pl'):cssText('right:' .. distance .. 'px')
else -- specified right or autodetected to right
builder:addClass('pr'):cssText('left:' .. distance .. 'px')
end
builder = builder:tag('div')
:wikitext(label)
if background then
builder:cssText('background-color:' .. background)
end
return builder:done()
end
local function getX(longitude, left, right)
local width = (right - left) % 360
if width == 0 then
width = 360
end
local distanceFromLeft = (longitude - left) % 360
-- the distance needed past the map to the right equals distanceFromLeft - width. the distance needed past the map to the left equals 360 - distanceFromLeft. to minimize page stretching, go whichever way is shorter
if distanceFromLeft - width / 2 >= 180 then
distanceFromLeft = distanceFromLeft - 360
end
return 100 * distanceFromLeft / width
end
local function getY(latitude, top, bottom)
return 100 * (top - latitude) / (top - bottom)
end
function p.mark(frame, args, map)
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map~'})
end
local mapnames = {}
if not map then
if args[1] then
map = {}
for mapname in mw.text.gsplit(args[1], '#', true) do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
mapnames[#mapnames + 1] = mapname
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
args[1] = 'World'
end
end
if type(map) == 'table' then
local outputs = {}
local oldargs = args[1]
for k,v in ipairs(map) do
args[1] = mapnames[k]
outputs[k] = tostring(p.mark(frame, args, v))
end
args[1] = oldargs
return table.concat(outputs, '#PlaceList#') .. '#PlaceList#'
end
local x, y, longitude, latitude
longitude = decdeg(args.lon_deg, args.lon_min, args.lon_sec, args.lon_dir, args.long, 'longitude')
latitude = decdeg(args.lat_deg, args.lat_min, args.lat_sec, args.lat_dir, args.lat, 'latitude')
if args.excludefrom then
-- If this mark is to be excluded from certain maps entirely (useful in the context of multiple maps)
for exclusionmap in mw.text.gsplit(args.excludefrom, '#', true) do
-- Check if this map is excluded. If so, return an empty string.
if args[1] == exclusionmap then
return ''
end
end
end
local builder = mw.html.create()
local currentTitle = mw.title.getCurrentTitle()
if args.coordinates then
-- Temporarily removed to facilitate infobox conversion. See [[Wikipedia:Coordinates in infoboxes]]
-- if longitude or latitude then
-- error('Coordinates from [[Module:Coordinates]] and individual coordinates cannot both be provided')
-- end
longitude = coord2text('longitude', args.coordinates)
latitude = coord2text('latitude', args.coordinates)
elseif not longitude and not latitude and args.useWikidata then
-- If they didn't provide either coordinate, try Wikidata. If they provided one but not the other, don't.
local entity = mw.wikibase.getEntity()
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1].mainsnak.snaktype == 'value' then
local value = entity.claims.P625[1].mainsnak.datavalue.value
longitude, latitude = value.longitude, value.latitude
end
if args.link and (currentTitle.namespace == 0) then
builder:wikitext('[[Category:Location maps with linked markers with coordinates from Wikidata]]')
end
end
if not longitude then
error('No value was provided for longitude')
elseif not latitude then
error('No value was provided for latitude')
end
if currentTitle.namespace > 0 then
if (not args.lon_deg) ~= (not args.lat_deg) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Degrees]]')
elseif (not args.lon_min) ~= (not args.lat_min) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Minutes]]')
elseif (not args.lon_sec) ~= (not args.lat_sec) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Seconds]]')
elseif (not args.lon_dir) ~= (not args.lat_dir) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Hemisphere]]')
elseif (not args.long) ~= (not args.lat) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Decimal]]')
end
end
if ((tonumber(args.lat_deg) or 0) < 0) and ((tonumber(args.lat_min) or 0) ~= 0 or (tonumber(args.lat_sec) or 0) ~= 0 or (args.lat_dir and args.lat_dir ~='')) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if ((tonumber(args.lon_deg) or 0) < 0) and ((tonumber(args.lon_min) or 0) ~= 0 or (tonumber(args.lon_sec) or 0) ~= 0 or (args.lon_dir and args.lon_dir ~= '')) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if (((tonumber(args.lat_min) or 0) < 0) or ((tonumber(args.lat_sec) or 0) < 0)) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if (((tonumber(args.lon_min) or 0) < 0) or ((tonumber(args.lon_sec) or 0) < 0)) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if args.skew or args.lon_shift or args.markhigh then
mw.log('Removed parameter used in invocation.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
local key = (args.skew and 'skew' or '') ..
(args.lon_shift and 'lon_shift' or '') ..
(args.markhigh and 'markhigh' or '')
builder:wikitext('[[Category:Location maps with removed parameters|' .. key ..' ]]')
end
end
if map('x') ~= '' then
x = tonumber(mw.ext.ParserFunctions.expr(map('x', { latitude, longitude })))
else
x = tonumber(getX(longitude, map('left'), map('right')))
end
if map('y') ~= '' then
y = tonumber(mw.ext.ParserFunctions.expr(map('y', { latitude, longitude })))
else
y = tonumber(getY(latitude, map('top'), map('bottom')))
end
if (x < 0 or x > 100 or y < 0 or y > 100) and not args.outside then
mw.log('Mark placed outside map boundaries without outside flag set. x = ' .. x .. ', y = ' .. y)
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
local key = currentTitle.prefixedText
builder:wikitext('[[Category:Location maps with marks outside map and outside parameter not set|' .. key .. ' ]]')
end
end
local mark = args.mark or map('mark')
if mark == '' then
mark = 'Red pog.svg'
end
local marksize = tonumber(args.marksize) or tonumber(map('marksize')) or 8
local imageDiv = markImageDiv(mark, marksize, args.label or mw.title.getCurrentTitle().text, args.link or '', args.alt, args[2])
local labelDiv
if args.label and args.position ~= 'none' then
labelDiv = markLabelDiv(args.label, args.label_size or 91, args.label_width or 6, args.position, args.background, x, marksize)
end
return builder:node(markOuterDiv(x, y, imageDiv, labelDiv))
end
local function switcherSeparate(s)
if s == nil then return {} end
local retval = {}
for i in string.gmatch(s .. '#', '([^#]*)#') do
i = mw.text.trim(i)
retval[#retval + 1] = (i ~= '' and i)
end
return retval
end
function p.main(frame, args, map)
local caption_list = {}
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map', valueFunc = p.valueFunc})
end
if args.useWikidata == nil then
args.useWikidata = true
end
if not map then
if args[1] then
map = {}
for mapname in string.gmatch(args[1], '[^#]+') do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
end
if args['caption'] then
if args['caption'] == "" then
while #caption_list < #map do
caption_list[#caption_list + 1] = args['caption']
end
else
for caption in mw.text.gsplit(args['caption'], '##', true) do
caption_list[#caption_list + 1] = caption
end
end
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
end
end
if type(map) == 'table' then
local altmaps = switcherSeparate(args.AlternativeMap)
if #altmaps > #map then
error(string.format('%d AlternativeMaps were provided, but only %d maps were provided', #altmaps, #map))
end
local overlays = switcherSeparate(args.overlay_image)
if #overlays > #map then
error(string.format('%d overlay_images were provided, but only %d maps were provided', #overlays, #map))
end
if #caption_list > #map then
error(string.format('%d captions were provided, but only %d maps were provided', #caption_list, #map))
end
local outputs = {}
args.autoSwitcherLabel = true
for k,v in ipairs(map) do
args.AlternativeMap = altmaps[k]
args.overlay_image = overlays[k]
args.caption = caption_list[k]
outputs[k] = p.main(frame, args, v)
end
return '<div class="switcher-container">' .. table.concat(outputs) .. '</div>'
else
return p.top(frame, args, map) .. tostring( p.mark(frame, args, map) ) .. p.bottom(frame, args, map)
end
end
return p
e4ccfcc6e71c45a4355aa7240a0a8b81dc19f8eb
Template:WPMILHIST Infobox style
10
25
55
2023-11-02T18:21:58Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:WPMILHIST_Infobox_style]]
wikitext
text/x-wiki
<includeonly>{{#switch:{{{1|}}}
|main_box=class="{{#if:{{{2|}}}|infobox {{{2}}}|infobox}}" style="{{#invoke:Data|Module:WPMILHIST Infobox style|main_box_raw}}"
|{{#invoke:Data|Module:WPMILHIST Infobox style|{{{1|}}}}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
b117547056afc703e2f1371497b0a53fa5a22751
Module:Data
828
31
67
2023-11-02T18:21:58Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Data]]
Scribunto
text/plain
local mt = {}
function mt.__index(t, k)
return function(frame)
local data = mw.loadData(k)
local i = 1
for _,v in ipairs(frame.args) do
local ty = type(data)
if ty ~= 'table' then
local args = {}
for j = 1, i - 1 do
args[j] = frame.args[j]
end
if frame.args.softfail then
return '<span class="error">[[Category:Pages with failed Module:Data lookups]]Error: Tried to read index "' .. mw.text.nowiki(v) .. '" of mw.loadData("' .. mw.text.nowiki(k) .. '").' .. mw.text.nowiki(table.concat(args, '.')) .. ', which is a ' .. ty .. '</span>'
else
error('Tried to read index "' .. v .. '" of mw.loadData("' .. k .. '").' .. table.concat(args, '.') .. ', which is a ' .. ty)
end
end
data = data[v]
i = i + 1
end
return data
end
end
return setmetatable({}, mt)
654c5ba2e0c73e7415457ca7a67fe0dfacfdba3b
Module:WPMILHIST Infobox style
828
32
69
2023-11-02T18:21:58Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:WPMILHIST_Infobox_style]]
Scribunto
text/plain
local retval = {
main_box_raw_auto_width = 'border-spacing:2px;',
header_raw = 'background-color:#C3D6EF;text-align:center;vertical-align:middle;font-size:110%;',
sub_header_raw = 'background-color:#DCDCDC;text-align:center;vertical-align:middle;',
header_color = 'background-color:#C3D6EF;',
nav_box = 'margin:0;float:right;clear:right;width:25.5em;margin-bottom:0.5em;margin-left:1em;',
nav_box_child = 'margin:0;float:right;clear:right;width:25em;margin-bottom:0.5em;',
nav_box_wide = '',
nav_box_header = 'background-color:#C3D6EF;',
nav_box_wide_header = 'background-color:#C3D6EF;',
nav_box_label = 'background-color:#DCDCDC;',
image_box_raw = 'text-align:center;border-bottom:1px solid #aaa;line-height:1.5em;',
image_box_plain_raw = 'text-align:center;line-height:1.5em;',
internal_border = '1px dotted #aaa;',
section_border = '1px solid #aaa;'
}
retval.main_box_raw = 'width:25.5em;' .. retval.main_box_raw_auto_width
retval.header_bar = 'style="' .. retval.header_raw .. '"'
retval.sub_header_bar = 'style="' .. retval.sub_header_raw .. '"'
retval.image_box = 'style="' .. retval.image_box_raw .. '"'
retval.image_box_plain = 'style="' .. retval.image_box_plain_raw .. '"'
return retval
0f9ea47bc17e40cdabbae6de54f63e40ae502f8e
Template:Military navigation
10
36
77
2023-11-02T18:21:58Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Military_navigation]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Military navigation|main}}</includeonly><noinclude>
{{Documentation|Wikipedia:WikiProject Military history/Military navigation}}
{{Sandbox other||
[[Category:Navigational box wrapper templates]]
[[Category:Military navigational boxes| ]]
}}</noinclude>
10eb2cd55540aab60dd8603c113e21995e9bb545
Module:Military navigation
828
37
79
2023-11-02T18:21:58Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Military_navigation]]
Scribunto
text/plain
local p = { }
local Navbox = require('Module:Navbox')
local Styles = require('Module:WPMILHIST Infobox style')
local function isblank(s)
return (not s) or s == ''
end
local function isnotblank(s)
return s and s ~= ''
end
function p.main(frame)
local args = { }
local pargs = frame:getParent().args
local sargs = {}
local tcats = ''
-- process bodystyle and titlestyle
if (pargs['style'] or '') == 'wide' then
args['titlestyle'] = Styles['nav_box_wide_header']
args['bodystyle'] = Styles['nav_box_wide']
else
args['titlestyle'] = Styles['nav_box_header']
if (pargs['border'] or '') == 'child' or
(pargs['border'] or '') == 'subgroup' then
args['bodystyle'] = Styles['nav_box_child']
tcats = tcats .. '[[Category:Pages using military navigation subgroups without wide style]]'
else
args['bodystyle'] = Styles['nav_box']
end
end
sargs['titlestyle'] = 1
sargs['bodystyle'] = 1
-- process groupstyle, abovestyle, belowstyle
args['groupstyle'] = Styles['nav_box_label'] .. (pargs['groupstyle'] or '')
sargs['groupstyle'] = 1
args['abovestyle'] = Styles['nav_box_label'] .. (pargs['abovestyle'] or '')
sargs['abovestyle'] = 1
args['belowstyle'] = Styles['nav_box_label'] .. (pargs['belowstyle'] or '')
sargs['belowstyle'] = 1
-- process oddstyle, evenstyle
args['oddstyle'] = isnotblank(pargs['odd_color'])
and ('background:' .. pargs['odd_color']) or nil
sargs['oddstyle'] = 1
args['evenstyle'] = isnotblank(pargs['even_color'])
and ('background:' .. pargs['even_color']) or nil
sargs['evenstyle'] = 1
-- process name and rawname
args['name'] = (isnotblank(pargs['name']) and pargs['name']) or pargs['rawname']
if isblank(args['name']) then args['navbar'] = 'plain' end
sargs['name'] = 1
sargs['rawname'] = 1
-- copy the remaining args
for k, v in pairs(pargs) do
if v and v ~= '' and sargs[k] == nil then
args[k] = v
end
end
-- add allow wrap
if args['title'] and (pargs['style'] or '') ~= 'wide' then
if not mw.ustring.match(args['title'], '<span class="wrap">') then
-- probably a more efficient way to match 15 or more characters
local m = '[^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|]'
m = m .. m .. m
args['title'] = mw.ustring.gsub(args['title'],
'%[%[(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%1</span>]]')
args['title'] = mw.ustring.gsub(args['title'],
'%[%[([^%[%]<>|]*)|(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%2</span>]]')
end
end
-- add navbox-vertical for non-wide format
if (pargs['style'] or '') ~= 'wide' then
args['bodyclass'] = 'navbox-vertical' .. (args['bodyclass'] and (' ' .. args['bodyclass']) or '')
end
return tcats .. Navbox._navbox(args)
end
return p
26dd1b8952c65fbc4d05e418e8d7c3daed93fa49
Template:Wrap
10
44
93
2023-11-02T18:21:59Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Wrap]]
wikitext
text/x-wiki
<includeonly><span class="wrap">{{{1| }}}</span></includeonly><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
aa85f77c2939e3f50fa04a160b08510cf331ee11
Template:Para
10
62
129
2023-11-02T18:21:59Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Para]]
wikitext
text/x-wiki
<code class="tpl-para" style="word-break:break-word;{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
06006deea2ed5d552aab61b4332321ab749ae7e8
Template:Start date
10
98
201
2023-11-02T18:21:59Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Start_date]]
wikitext
text/x-wiki
<includeonly>{{#if: {{{4|}}}
|{{#if: {{{5|}}}
|{{padleft:{{{4}}}|2|0}}:{{padleft:{{{5}}}|2|0}}{{#if: {{{6|}}}
|:{{padleft:{{{6}}}|2|0}} }}, }} }}<!--ABOVE FOR TIME; BELOW FOR DATE
-->{{#if: {{{1|}}}
|{{#if: {{{2|}}}
|{{#if: {{{3|}}}
|{{#if: {{{df|}}}|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}}|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}},}} {{{1}}}|{{MONTHNAME|{{{2}}}}} {{{1}}}}}|{{{1}}}}}}}{{#if: {{{7|}}}
| ({{#ifeq: {{{7}}}|Z|UTC|{{{7}}}}})}}<!-- BELOW FOR hCalendar
--><span style="display:none"> (<span class="bday dtstart published updated">{{#if: {{{1|}}}
| {{{1}}}{{#if: {{{2|}}}
| -{{padleft:{{{2}}}|2|0}}{{#if: {{{3|}}}
| -{{padleft:{{{3}}}|2|0}} }} }}<!--
-->{{#if: {{{4|}}}
| T{{padleft:{{{4}}}|2|0}}{{#if: {{{5|}}}
| :{{padleft:{{{5}}}|2|0}}{{#if: {{{6|}}}
| :{{padleft:{{{6}}}|2|0}} }} }} }} }}{{{7|}}}</span>)</span></includeonly><noinclude>
{{documentation}}
</noinclude>
2bdc464c20f7d568f3d482c9fb2d04f5d266f982
Template:Str left
10
29
63
2023-11-02T18:22:00Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Str_left]]
wikitext
text/x-wiki
<includeonly>{{safesubst:padleft:|{{{2|1}}}|{{{1}}}}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
2048b0d7b35e156528655b1d090e8b5ffab3f400
Template:Spaced ndash
10
65
135
2023-11-02T18:22:00Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Spaced_ndash]]
wikitext
text/x-wiki
#REDIRECT [[Template:Spaced en dash]]
{{R from move}}
943ce837a48a4907650d7398e8d10271b21dde62
Template:Country data Sweden
10
70
145
2023-11-02T18:22:00Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Country_data_Sweden]]
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Sweden
| flag alias = Flag of Sweden.svg
| flag alias-army = Naval Ensign of Sweden.svg
| flag alias-air force =Naval Ensign of Sweden.svg
| flag alias-1818 = Swedish and Norwegian merchant flag 1818-1844.svg
| flag alias-1844 = Swedish civil ensign (1844โ1905).svg
| flag alias-1905 = Flag of Sweden (pre-1906).svg
| flag alias-naval = Naval Ensign of Sweden.svg
| flag alias-naval-1844 = Naval Ensign of Sweden (1844-1905).svg
| flag alias-naval-1815 = Swedish and Norwegian naval ensign (1815-1844).svg
| link alias-army = Swedish Army
| link alias-air force = Swedish Air Force
| link alias-naval = Swedish Navy
| flag alias-navy = Naval Ensign of Sweden.svg
| link alias-navy = Swedish Navy
| link alias-football = Sweden {{{mw|men's}}} national {{{age|}}} football team
| border-army =
| border-air force =
| border-naval =
| border-navy =
| border-naval-1815 =
| border-naval-1844 =
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1818
| var2 = 1844
| var3 = 1905
| var4 = naval-1844
| var5 = naval-1815
| redir1 = SWE
</noinclude>
}}
c92ed3fc692a32952044c5efaac25842974ca1c4
Template:Collapse bottom
10
18
41
2023-11-02T18:22:01Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Collapse_bottom]]
wikitext
text/x-wiki
<includeonly>|}</div></includeonly><noinclude>
{{Documentation|Template:Collapse top/doc}}
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
64b210e8ab0882b262da50e9fbccf2132bc34fab
Template:Remove first word
10
30
65
2023-11-02T18:22:01Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Remove_first_word]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:String|replace|source={{{1}}}|pattern=^[^{{{sep|%s}}}]*{{{sep|%s}}}*|replace=|plain=false}}<noinclude>{{Documentation}}</noinclude>
df7a9e692f68be1581be06af5f51eaed5483b4c8
Template:KIA
10
78
161
2023-11-02T18:22:01Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:KIA]]
wikitext
text/x-wiki
[[<!---(link:)-->{{{1|Killed in action}}}<!--
-->|<!--(label:)-->{{#ifeq:{{{alt|}}}|yes |(KIA) |<span style="font-family:'Times New Roman','Old English Text MT',serif">{{#ifeq:{{{bold|}}}|no |† |'''†'''}}</span>}}<!--
-->]]<noinclude>
{{Documentation}}
</noinclude>
40db638380717ea2f21d23962d35f009deec5b20
Template:Collapse top
10
88
181
2023-11-02T18:22:01Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Collapse_top]]
wikitext
text/x-wiki
<div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section -->
{| <!-- Template:Collapse top --> class="mw-collapsible mw-archivedtalk {{<includeonly>safesubst:</includeonly>#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}} {{{class|}}}" style="background: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|Silver}}}; margin: 0.2em auto auto; width:{{<includeonly>safesubst:</includeonly>#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}; padding: 1px;"
|-
! style="background: {{{bg|#{{main other|F0F2F5|CCFFCC}}}}}; font-size:87%; padding:0.2em 0.3em; text-align:{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}|left|{{<includeonly>safesubst:</includeonly>#if:{{{align|}}}|left|center}}}}; {{<includeonly>safesubst:</includeonly>#if:{{{fc|}}}|color: {{{fc}}};|}}" | <div style="font-size:115%;{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}||margin:0 4em}}">{{{1|{{{title|{{{reason|{{{header|{{{heading|{{{result|Extended content}}}}}}}}}}}}}}}}}}</div>
{{<includeonly>safesubst:</includeonly>#if:{{{warning|{{{2|}}}}}}
|{{<includeonly>safesubst:</includeonly>!}}-
{{<includeonly>safesubst:</includeonly>!}} style="text-align:center; font-style:italic;" {{<includeonly>safesubst:</includeonly>!}} {{{2|The following is a closed discussion. {{strongbad|Please do not modify it.}} }}} }}
|-
| style="border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|White}}};" {{<includeonly>safesubst:</includeonly>!}}<noinclude>
{{lorem ipsum|3}}
{{Collapse bottom}}
{{Documentation}}
</noinclude>
247cc43d5198baf8804d0926529cbbdd7be91113
Template:Campaignbox
10
35
75
2023-11-02T18:22:02Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Campaignbox]]
wikitext
text/x-wiki
<includeonly>{{Military navigation
|name = {{#if:{{{raw_name|}}} |{{{raw_name|}}} |{{#if:{{{title|}}} |{{{name|}}} |}} }}
|state = {{{state|}}}
|border = {{{border|}}}
|title = <span style="line-height:1.6em">{{#if:{{{title|}}}|{{{title}}}|{{{name}}}}}</span>
|bodyclass = {{{bodyclass|}}}
|listclass = {{{listclass|}}}
|list1 = {{{battles|}}}
|below = {{{notes|}}}
}}{{#ifeq:{{NAMESPACE}}|Template|[[Category:Campaignbox templates]]}}</includeonly><noinclude>
{{documentation}}
</noinclude>
bd5acf07aa1526d63d10975ff20fe9d70de2f838
Module:Infobox military conflict
828
92
189
2023-11-02T18:22:02Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Infobox_military_conflict]]
Scribunto
text/plain
require('strict')
local infoboxStyle = mw.loadData('Module:WPMILHIST Infobox style')
local templatestyles = 'Module:Infobox military conflict/styles.css'
local IMC = {}
IMC.__index = IMC
function IMC:renderPerCombatant(builder, headerText, prefix, suffix)
prefix = prefix or ''
suffix = suffix or ''
local colspans = {}
-- This may result in colspans[1] getting set twice, but
-- this is no big deal. The second set will be correct.
local lastCombatant = 1
for i = 1,self.combatants do
if self.args[prefix .. i .. suffix] then
colspans[lastCombatant] = i - lastCombatant
lastCombatant = i
end
end
local jointText = self.args[prefix .. (self.combatants + 1) .. suffix]
if headerText and (colspans[1] or jointText) then
builder:tag('tr')
:tag('th')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.header_raw)
:wikitext(headerText)
end
-- The only time colspans[1] wouldn't be set is if no
-- combatant has a field with the given prefix and suffix.
if colspans[1] then
-- Since each found argument set the colspan for the previous
-- one, the final one wasn't set above, so set it now.
colspans[lastCombatant] = self.combatants - lastCombatant + 1
builder = builder:tag('tr')
for i = 1,self.combatants do
-- At this point, colspans[i] will be set for i=1 unconditionally, and for
-- any other value of i where self.args[prefix .. i .. suffix] is set.
if colspans[i] then
builder:tag('td')
-- don't bother emitting colspan="1"
:attr('colspan', colspans[i] ~= 1 and colspans[i] or nil)
:css('width', math.floor(100 / self.combatants * colspans[i] + 0.5) .. '%')
-- no border on the right of the rightmost column
:css('border-right', i ~= lastCombatant and infoboxStyle.internal_border or nil)
-- no padding on the left of the leftmost column
:css('padding-left', i ~= 1 and '0.25em' or nil)
-- don't show the border if we're directly under a header
:css('border-top', not headerText and infoboxStyle.internal_border or nil)
:newline()
:wikitext(self.args[prefix .. i .. suffix])
end
end
end
if jointText then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('text-align', 'center')
-- don't show the border if we're directly under a header
:css('border-top', (not headerText or colspans[1]) and infoboxStyle.internal_border or nil)
:newline()
:wikitext(jointText)
end
end
function IMC:renderHeaderTable(builder)
builder = builder:tag('table')
:css('width', '100%')
:css('margin', 0)
:css('padding', 0)
:css('border', 0)
:css('display', 'inline-table')
if self.args.date then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Date')
:done()
:tag('td')
:wikitext(self.args.date)
end
builder = builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Location')
:done()
:tag('td')
:tag('div')
:addClass('location')
:wikitext(self.args.place or '{{{place}}}') -- hack so that people who don't know Lua know that this parameter is required
:done()
if self.args.coordinates then
builder:wikitext(self.args.coordinates)
end
builder = builder:done():done()
-- only for "Putsch"
if self.args.action then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext(self.args.action and 'Action')
:done()
:tag('td')
:wikitext(self.args.action)
end
if self.args.status or self.args.result then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext(self.args.status and 'Status' or 'Result')
:done()
:tag('td')
:addClass('status')
:newline()
:wikitext(self.args.status or self.args.result)
end
if self.args.territory then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Territorial<br />changes')
:done()
:tag('td')
:newline()
:wikitext(self.args.territory)
end
end
function IMC:render()
local builder = mw.html.create()
if self.args.campaignbox then
-- this should be the same as using {{stack|clear=right|...}}
builder:wikitext(self.frame:expandTemplate{ title = 'stack begin', args = { clear='true'} })
end
builder = builder:tag('table')
:addClass('infobox vevent')
:cssText(infoboxStyle.main_box_raw)
:css('width', self.args.width or nil)
builder:tag('tr')
:tag('th')
:addClass('summary')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.header_raw)
:wikitext(self.args.conflict or mw.title.getCurrentTitle().text)
if self.args.partof then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.sub_header_raw)
:wikitext('Part of ' .. self.args.partof)
end
if self.args.image then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.image_box_raw)
:wikitext(string.format('%s%s%s',
require('Module:InfoboxImage').InfoboxImage{args = {
image = self.args.image,
size = self.args.image_size,
sizedefault = 'frameless',
upright = 1,
alt = self.args.alt
}},
self.args.caption and '<br />' or '',
self.args.caption or ''
))
end
self:renderHeaderTable(builder:tag('tr'):tag('td'):attr('colspan', self.combatants))
self:renderPerCombatant(builder, self.args.combatants_header or 'Belligerents', 'combatant')
-- can be un-hardcoded once gerrit:165108 is merged
for _,v in ipairs{'a','b','c','d'} do
self:renderPerCombatant(builder, nil, 'combatant', v)
end
self:renderPerCombatant(builder, self.args.commanders_header or 'Commanders and leaders', 'commander')
for _,v in ipairs{'a','b','c','d'} do
self:renderPerCombatant(builder, nil, 'commander', v)
end
self:renderPerCombatant(builder, self.args.units_header or 'Units involved', 'units')
self:renderPerCombatant(builder, self.args.strengths_header or 'Strength', 'strength')
self:renderPerCombatant(builder, self.args.polstrengths_header or 'Political support', 'polstrength')
self:renderPerCombatant(builder, self.args.milstrengths_header or 'Military support', 'milstrength')
self:renderPerCombatant(builder, self.args.casualties_header or 'Casualties and losses', 'casualties')
if self.args.notes then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('border-top', infoboxStyle.section_border)
:newline()
:wikitext(self.args.notes)
end
if self.args.map_type then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('border-top', infoboxStyle.internal_border)
:node(require('Module:Location map').main(self.frame, {
self.args.map_type,
relief = self.args.map_relief,
coordinates = self.args.coordinates,
width = self.args.map_size or 220,
float = 'center',
border = 'none',
mark = self.args.map_mark,
marksize = self.args.map_marksize or 8,
label = self.args.map_label,
alt = self.args.map_alt,
caption = self.args.map_caption or ('Location within '
.. (require('Module:Location map').data(self.frame, {self.args.map_type, 'name'})))
}))
end
builder = builder:done()
if self.args.campaignbox then
builder = builder:done()
builder:wikitext(self.args.campaignbox .. self.frame:expandTemplate{ title = 'stack end'})
end
return builder
end
function IMC.new(frame, args)
if not args then
args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:Infobox military conflict'})
end
local obj = {
frame = frame,
args = args
}
-- until gerrit:165108 is merged, there's still a cap on combatants, but as soon as it merges, we can update this little bit of code to uncap it
-- also, don't try to make this more efficient, or references could be in the wrong order
obj.combatants = 2
for _,v in ipairs{'', 'a', 'b', 'c', 'd'} do
for i = 1,5 do
if args['combatant' .. i .. v] then
obj.combatants = math.max(obj.combatants, i)
end
end
end
return setmetatable(obj, IMC)
end
local p = {}
function p.main(frame)
return frame:extensionTag{ name = 'templatestyles', args = { src = templatestyles} } .. tostring(IMC.new(frame):render())
end
return p
737c5c2ab35460ae4165baecc4a140ed140cd602
Template:Documentation
10
8
21
2023-11-02T18:22:03Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Documentation]]
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Add categories to the /doc subpage -->
</noinclude>
9e62b964e96c4e3d478edecbfcb3c0338ae8a276
Template:Large
10
53
111
2023-11-02T18:22:03Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Large]]
wikitext
text/x-wiki
<span style="font-size:120%">{{{1}}}</span><noinclude>
{{Documentation}}
</noinclude>
8ba6ec8c3178e22dc1f05aa239df8a2b052be668
Template:DOW
10
80
165
2023-11-02T18:22:03Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:DOW]]
wikitext
text/x-wiki
([[Killed in action|{{abbr|DOW|Died of wounds}}]])<noinclude>
<!-- Add categories and interwikis to the /doc subpage, not here! -->
{{Documentation}}
</noinclude>
a14551ef11993cd99ef9b8d4f781f0feaf2e7640
Template:Location map
10
89
183
2023-11-02T18:22:03Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Location_map]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Location map|main}}</includeonly><noinclude>{{documentation}}</noinclude>
732416b8068d2dc3549db5aa5ffa786beb502886
Module:Documentation
828
20
45
2023-11-02T18:22:04Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Documentation]]
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
local format = mw.ustring.format
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return format('[[%s|%s]]', page, display)
else
return format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return format(
'<span class="%s">(%s)</span>',
message('toolbar-class'),
table.concat(ret, ' | ')
)
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:attr('role', 'complementary')
:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)
:attr('aria-label', args.heading == '' and 'Documentation' or nil)
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.canonicalUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[File:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
-- 'module-sandbox-category' --> 'Module sandboxes'
-- 'other-sandbox-category' --> 'Sandboxes outside of template or module namespace'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype, sandboxCat
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
sandboxCat = message('sandbox-category')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
sandboxCat = message('module-sandbox-category')
else
pagetype = message('sandbox-notice-pagetype-other')
sandboxCat = message('other-sandbox-category')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(sandboxCat)
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
return {
title = title,
docTitle = docTitle,
-- View, display, edit, and purge links if /doc exists.
viewLinkDisplay = message('view-link-display'),
editLinkDisplay = message('edit-link-display'),
historyLinkDisplay = message('history-link-display'),
purgeLinkDisplay = message('purge-link-display'),
preload = preload,
createLinkDisplay = message('create-link-display')
}
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local docTitle = data.docTitle
-- yes, we do intend to purge the template page on which the documentation appears
local purgeLink = makeWikilink("Special:Purge/" .. data.title.prefixedText, data.purgeLinkDisplay)
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, data.editLinkDisplay)
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, data.historyLinkDisplay)
return "[" .. viewLink .. "] [" .. editLink .. "] [" .. historyLink .. "] [" .. purgeLink .. "]"
else
local createLink = makeUrlLink(docTitle:canonicalUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
return "[" .. createLink .. "] [" .. purgeLink .. "]"
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:attr('id', 'documentation-heading')
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editDisplay = message('edit-link-display')
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, editDisplay)
local historyDisplay = message('history-link-display')
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:canonicalUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeWikilink("Special:EditPage/" .. sandboxPage, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:canonicalUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeWikilink("Special:EditPage/" .. testcasesPage, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:canonicalUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
0f0f558e631e573a8b022c2a20bfc47c4137d640
Module:Documentation/config
828
22
49
2023-11-02T18:22:04Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Documentation/config]]
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category'] - A category to add to all template sandboxes.
-- cfg['module-sandbox-category'] - A category to add to all module sandboxes.
-- cfg['module-sandbox-category'] - A category to add to all sandboxe not in templates or modules.
cfg['sandbox-category'] = 'Template sandboxes'
cfg['module-sandbox-category'] = 'Module sandboxes'
cfg['other-sandbox-category'] = 'Sandboxes outside of template or module namespace'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Help:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
56b6127664e31128dea1cecf2e392cf9313df6a3
Template:Sandbox other
10
17
39
2023-11-02T18:22:05Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Sandbox_other]]
wikitext
text/x-wiki
{{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
91e4ae891d6b791615152c1fbc971414961ba872
Template:Country data Holy Roman Empire
10
73
151
2023-11-02T18:22:05Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Country_data_Holy_Roman_Empire]]
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Holy Roman Empire
| flag alias = Banner of the Holy Roman Emperor (after 1400).svg
| flag alias-1200 = Flag of the Holy Roman Empire (1200-1350).svg
| flag alias-old = Heiliges Rรถmisches Reich - Reichssturmfahne vor 1433.svg
| size = {{{size|}}}
| name = {{{name|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1200
| var2 = old
</noinclude>
}}
c24cc53598b544658ee4420e6aa0370eca6c4d78
Template:Blue
10
77
159
2023-11-02T18:22:06Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Blue]]
wikitext
text/x-wiki
<span style="color:blue">{{{1}}}</span><noinclude>
<!-- Add categories and interwikis to the /doc subpage, not here! -->
{{Documentation}}</noinclude>
89f3353953a76d63c4ba5cd23af400b64ef178f4
Template:Dummy reference
10
82
169
2023-11-02T18:22:06Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Dummy_reference]]
wikitext
text/x-wiki
<sup class="reference nowrap ltr" style="color:#002bb8;">[{{#ifeq:{{yes/no|{{{txtital|}}}}}|yes|<span style="font-style:italic">}}{{#if:{{{txtcol|}}}|<span style="color:{{{txtcol|}}}">}}{{{1|1}}}{{#if:{{{txtcol|}}}|</span>}}{{#ifeq:{{yes/no|{{{txtital|}}}}}|yes|</span>}}]</sup><noinclude>
{{documentation}}
</noinclude>
7be6798eb28af3f887fa775b50dc87e0c575cde9
Template:Yes/no
10
23
51
2023-11-02T18:22:07Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Yes/no]]
wikitext
text/x-wiki
#REDIRECT [[Template:Yesno]]
80e458cd4d851471d13896c26ecf96ce6dcdd579
Template:Fakeref
10
81
167
2023-11-02T18:22:07Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Fakeref]]
wikitext
text/x-wiki
#REDIRECT [[Template:Dummy reference]]
c85c391fe2de3ebfd2154c56303a2085c57e9dd2
Module:Location map/data/Earth
828
103
211
2023-11-02T18:22:07Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Location_map/data/Earth]]
Scribunto
text/plain
return {
name = 'Earth',
top = 90,
bottom = -90,
left = -180,
right = 180,
image = 'World location map (equirectangular 180).svg',
image1='World location map (equirectangular 180).svg'}
0c7a9c4349065ea43134d0a61037d31862f2a042
Template:Documentation subpage
10
59
123
2023-11-02T18:22:08Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Documentation_subpage]]
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
| <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
</includeonly><!--
-->{{#ifeq:{{{doc-notice|show}}} |show
| {{Mbox
| type = notice
| style = margin-bottom:1.0em;
| image = [[File:Edit-copy green.svg|40px|alt=|link=]]
| text =
{{strong|This is a [[Wikipedia:Template documentation|documentation]] [[Wikipedia:Subpages|subpage]]}} for {{terminate sentence|{{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}}}<br />It may contain usage information, [[Wikipedia:Categorization|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} |{{#ifeq:{{SUBJECTSPACE}} |{{ns:User}} |{{lc:{{SUBJECTSPACE}}}} template page |{{#if:{{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}.
}}
}}<!--
-->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
-->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
| <includeonly><!--
-->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
| [[Category:Documentation subpages without corresponding pages]]
}}<!--
--></includeonly>
}}<!--
(completing initial #ifeq: at start of template:)
--><includeonly>
| <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
}}<!--
--></includeonly><noinclude>{{Documentation}}</noinclude>
41ca90af0945442788a2dbd08c8c54a61a23c057
Template:Tlf
10
63
131
2023-11-02T18:22:08Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Tlf]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link with link off]]
{{Redirect category shell|
{{R from move}}
}}
52759e1d3f7c9aa4a03d0b7d4f84f4c6adf53edf
Template:Template link with link off
10
64
133
2023-11-02T18:22:08Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Template_link_with_link_off]]
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nowrap=yes|nolink=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlf}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
b099fea5d1f36b0b4b9cb253ad3a9f4e095f6851
Template:Infobox military operation
10
97
199
2023-11-02T18:22:09Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Infobox_military_operation]]
wikitext
text/x-wiki
{{infobox
|bodyclass = vevent
|bodystyle = {{WPMILHIST Infobox style|main_box_raw}}
|abovestyle = {{WPMILHIST Infobox style|header_raw}}
|aboveclass = summary
| headerstyle = {{WPMILHIST Infobox style|header_raw}}
|above = {{if empty|{{{title|}}}|{{{name|}}}|{{PAGENAMEBASE}}}}
|subheaderstyle = {{WPMILHIST Infobox style|sub_header_raw}}
|subheader = {{br separated entries|{{{subtitle|}}}|{{#if:{{{partof|}}}{{{conflict|}}}|Part of {{if empty|{{{conflict|}}}|{{{partof|}}}}} }}}}
|labelstyle = padding-right: 1em;
|imagestyle = {{WPMILHIST Infobox style|image_box_raw}}
|image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|}}}|upright={{{image_upright|1}}}|alt={{{alt|}}}}}
|caption = {{{caption|}}}
| label1 = {{#if:{{{scope|}}}|Operational scope|Type}}
| data1 = {{if empty|{{{scope|}}}|{{{type|}}}}}
| label2 = Location{{#if:{{{location2|}}}|s}}
| data2 = {{br separated entries
|1 = {{#if:{{{location|{{{place|}}}}}}|<div style="display:inline;" class="location">{{{location|{{{place|}}}}}}</div>}}
|2 = {{{coordinates|}}}
|3 = {{#if:{{{location2|}}}|<div style="display:inline;" class="location">{{{location2|}}}</div>}}
|4 = {{#if:{{{location2|}}}|{{{coordinates2|}}}}}
|5 = {{#if:{{{location3|}}}|<div style="display:inline;" class="location">{{{location3|}}}</div>}}
|6 = {{#if:{{{location3|}}}|{{{coordinates3|}}}}}
|7 = {{#if:{{{location4|}}}|<div style="display:inline;" class="location">{{{location4|}}}</div>}}
|8 = {{#if:{{{location4|}}}|{{{coordinates4|}}}}}
|9 = {{#if:{{{location5|}}}|<div style="display:inline;" class="location">{{{location5|}}}</div>}}
|10= {{#if:{{{location5|}}}|{{{coordinates5|}}}}}
|11= {{#if:{{{location6|}}}|<div style="display:inline;" class="location">{{{location6|}}}</div>}}
|12= {{#if:{{{location6|}}}|{{{coordinates6|}}}}}
|13= {{#if:{{{location7|}}}|<div style="display:inline;" class="location">{{{location7|}}}</div>}}
|14= {{#if:{{{location7|}}}|{{{coordinates7|}}}}}
|15= {{#if:{{{location8|}}}|<div style="display:inline;" class="location">{{{location8|}}}</div>}}
|16= {{#if:{{{location8|}}}|{{{coordinates8|}}}}}
|17= {{#if:{{{location9|}}}|<div style="display:inline;" class="location">{{{location9|}}}</div>}}
|18= {{#if:{{{location9|}}}|{{{coordinates9|}}}}}
|19= {{#if:{{{location10|}}}|<div style="display:inline;" class="location">{{{location10|}}}</div>}}
|20= {{#if:{{{location10|}}}|{{{coordinates10|}}}}}
}}
| label3 = Planned
| data3 = {{{planned|}}}
| label4 = Planned by
| data4 = {{{planned_by|}}}
| label5 = Commanded by
| data5 = {{{commanded_by|}}}
| label6 = {{#if:{{{target|}}}|Target|Objective}}
| data6 = {{if empty|{{{target|}}}|{{{objective|}}}}}
| label7 = Date
| data7 = {{br separated entries
|1 = {{if empty|{{{executed|}}}|{{{date|}}}}}
|2 = {{{time|}}}
|3 = {{#if:{{{time-begin|}}}|{{{time-begin}}} – {{{time-end|}}}}}
}} {{#if:{{{timezone|}}}|({{{timezone}}})}}
| label8 = Executed by
| data8 = {{if empty|{{{instigator|}}}|{{{executed_by|}}}}}
| label9 = Outcome
| data9 = {{{outcome|}}}
| label10 = Casualties
| data10 = {{if empty|{{{casualties|}}}|{{br separated entries
|1 = {{#if:{{{fatalities|}}}|{{{fatalities|}}} killed}}
|2 = {{#if:{{{injuries|}}}|{{{injuries|}}} injured}}
}} }}
| header27 = {{#if:{{{map_type|}}}|<nowiki />}}
| data28 = {{#if:{{{map_type|}}}|
{{#if:{{{coordinates2|}}}|
{{Location map many|{{{map_type}}}|coordinates1={{if empty|{{{map_coord|}}} | {{{coordinates|}}} }}|width={{{map_size|220}}}|float=center|border=infobox|label1={{{map_label|}}}|caption={{{map_caption|Location within {{#invoke:Location map|data|{{{map_type}}}|name}} }}}
|coordinates2={{{coordinates2|}}}|label2={{{map_label2|}}}
{{#if:{{{coordinates3|}}}|{{!}}coordinates3={{{coordinates3|}}}{{!}}label3={{{map_label3|}}} }}
{{#if:{{{coordinates4|}}}|{{!}}coordinates4={{{coordinates4|}}}{{!}}label4={{{map_label4|}}} }}
{{#if:{{{coordinates5|}}}|{{!}}coordinates5={{{coordinates5|}}}{{!}}label5={{{map_label5|}}} }}
{{#if:{{{coordinates6|}}}|{{!}}coordinates6={{{coordinates6|}}}{{!}}label6={{{map_label6|}}} }}
{{#if:{{{coordinates7|}}}|{{!}}coordinates7={{{coordinates7|}}}{{!}}label7={{{map_label7|}}} }}
{{#if:{{{coordinates8|}}}|{{!}}coordinates8={{{coordinates8|}}}{{!}}label8={{{map_label8|}}} }}
{{#if:{{{coordinates9|}}}|{{!}}coordinates9={{{coordinates9|}}}{{!}}label9={{{map_label9|}}} }}
{{#if:{{{coordinates10|}}}|{{!}}coordinates10={{{coordinates10|}}}{{!}}label10={{{map_label10|}}} }}
}}
|{{Location map|{{{map_type}}}|coordinates={{if empty|{{{map_coord|}}} | {{{coordinates|}}} }}|width={{{map_size|220}}}|float=center|border=infobox|label={{{map_label|}}}|caption={{{map_caption|Location within {{#invoke:Location map|data|{{{map_type}}}|name}} }}} }}
}}
}}
}}{{{campaignbox|}}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox military operation with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox military operation]] with unknown parameter "_VALUE_"|ignoreblank=y| alt | campaignbox | caption | casualties | commanded_by | conflict | coordinates | date | executed | executed_by | fatalities | image | image_size | image_upright | injuries | instigator | location | map_caption | map_coord | map_label | map_size | map_type | name | objective | outcome | partof | planned | planned_by | scope | subtitle | target | time | time-begin | time-end | timezone | title | type | coordinates2 | coordinates3 | coordinates4 | coordinates5 | coordinates6 | coordinates7 | coordinates8 | coordinates9 | coordinates10 | map_label2 | map_label3 | map_label4 | map_label5 | map_label6 | map_label7 | map_label8 | map_label9 | map_label10 | location2 | location3 | location4 | location5 | location6 | location7 | location8 | location9 | location10 }}<noinclude>
{{template doc}}
</noinclude>
829164a43ec689efc952b0722e2406cf1185cf66
Template:Campaignbox Punic Wars
10
61
127
2023-11-02T18:22:10Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Campaignbox_Punic_Wars]]
wikitext
text/x-wiki
{{Campaignbox
| name = Campaignbox Punic Wars
| title = [[Punic Wars]]
| listclass = hlist
| battles =
* [[First Punic War|First]]
* [[Mercenary War|Mercenary]]
* [[Second Punic War|Second]]
* [[Third Punic War|Third]]
}}<noinclude>
[[Category:Punic Wars navigational boxes|Punic wars]]
</noinclude>
68f988c5de0f66decd657e0721bfd60f1b4c7798
Template:Country data Electorate of Saxony
10
79
163
2023-11-02T18:22:10Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Country_data_Electorate_of_Saxony]]
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Electorate of Saxony
| shortname alias = Saxony
| flag alias = Flag of Electoral Saxony.svg
| size = {{{size|}}}
| name = {{{name|}}}
<noinclude>
| related1 = Kingdom of Saxony
| related2 = Saxony
| cat = Saxony electorate
</noinclude>
}}
92d992249b05224909f6fc125f5b07f9889af451
Template:Campaignbox Second Punic War
10
60
125
2023-11-02T18:22:11Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Campaignbox_Second_Punic_War]]
wikitext
text/x-wiki
{{Campaignbox
| name = Campaignbox Second Punic War
| title = [[Second Punic War|{{Wrap|Second Punic War}}]]
| listclass = hlist
| battles =
; Prelude
* [[Siege of Saguntum|Saguntum]]
* [[Battle of Rhone Crossing|Rhone]]
* [[Hannibal's crossing of the Alps|Crossing of the Alps]]
; Italy
* [[Battle of Ticinus|Ticinus]]
* [[Battle of the Trebia|Trebia]]
* [[Siege of Mutina (218 BC)|Mutina]]
* [[Battle of Placentia (217 BC)|Placentia]]
* [[Battle of Victumulae|Victumulae]]
* [[Battle of Lake Trasimene|Lake Trasimene]]
* [[Battle of Umbrian Lake|Umbrian Lake]]
* [[Hannibal's crossing of the Apennines|Crossing of the Apennines]]
* [[Battle of Ager Falernus|Ager Falernus]]
* [[Battle of Geronium|Geronium]]
* [[Battle of Cannae|Cannae]]
* [[Battle of Silva Litana|Silva Litana]]
* [[Battle of Nola (216 BC)|1st Nola]]
* [[Siege of Nuceria Alfaterna|Nuceria Alfaterna]]
* [[Siege of Casilinum (216โ215 BC)|1st Casilinum]]
* [[Battle of Hamae|Hamae]]
* [[Siege of Petelia|1st Petelia]]
* [[Battle of Cumae (215 BC)|Cumae]]
* [[Battle of Nola (215 BC)|2nd Nola]]
* [[Battle of Beneventum (214 BC)|1st Beneventum]]
* [[Battle of Nola (214 BC)|3rd Nola]]
* [[Siege of Casilinum (214 BC)|2nd Casilinum]]
* [[Battle of Lucania|Lucania]]
* [[Siege of Arpi|Arpi]]
* [[Battle of Tarentum (212 BC)|1st Tarentum]]
* [[Battle of Beneventum (212 BC)|2nd Beneventum]]
* [[Battle of Campi Veteres|Campi Veteres]]
* [[Battle of Capua|1st Capua]]
* [[Battle of the Silarus|Silarus]]
* [[Battle of Herdonia (212 BC)|1st Herdonia]]
* [[Siege of Capua (211 BC)|2nd Capua]]
* [[Hannibal's raid to Rome|Rome]]
* [[Battle of Sapriportis|Sapriportis]]
* [[Battle of Herdonia (210 BC)|2nd Herdonia]]
* [[Battle of Numistro|Numistro]]
* [[Battle of Canusium|Canusium]]
* [[Siege of Manduria|Manduria]]
* [[Siege of Caulonia|Caulonia]]
* [[Battle of Tarentum (209 BC)|2nd Tarentum]]
* [[Battle of Locri (208 BC)|Locri]]
* [[Battle of Petelia|2nd Petelia]]
* [[Battle of Venusia|Venusia]]
* [[Battle of Grumentum|Grumentum]]
* [[Battle of the Metaurus|Metaurus]]
* [[Battle of Crotona|Crotona]]
* [[Battle of Insubria|Insubria]]
; Iberia
* [[Battle of Cissa|Cissa]]
* [[Battle of Ebro River|Ebro River]]
* [[Battle of Ibera|Ibera]]
* [[Siege of Illiturgis|Illiturgis]]
* [[Battle of Munda (214 BC)|Munda]]
* [[Battle of Orongi|Orongi]]
* [[Battle of the Upper Baetis|Upper Baetis]]
* [[Battle of New Carthage|1st New Carthage]]
* [[Battle of Baria|Baria]]
* [[Battle of Baecula|Baecula]]
* [[Battle of Ilipa|Ilipa]]
* [[Mutiny at Sucro|Sucro]]
* [[Battle of Carteia|1st Carteia]]
* [[Battle of Carteia (naval)|2nd Carteia]]
* [[Battle of Cartagena (206 BC)|2nd New Carthage]]
; Sicily and Sardinia
* [[Battle of Lilybaeum|Lilybaeum]]
* [[Capture of Malta (218 BC)|Malta]]
* [[Battle of Decimomannu|Decimomannu]]
* [[Battle of Leontini|Leontini]]
* [[Siege of Syracuse (213โ212 BC)|Syracuse]]
* [[Battle of Himera (211 BC)|Himera]]
* [[Siege of Agrigentum (210 BC)|Agrigentum]]
; North Africa
* [[Siege of Utica (204 BC)|1st Utica]]
* [[Battle of Utica (203 BC)|2nd Utica]]
* [[Battle of the Great Plains|Great Plains]]
* [[Battle of Cirta|Cirta]]
* [[Battle of Zama|Zama]]
}}<noinclude>
[[Category:Punic Wars navigational boxes|Second Punic War]]
[[Category:Ancient Rome campaignbox templates|Campaign]]
</noinclude>
f3015ca66e7919fa2b20c4ea9e8e7f8fb1283732
Template:High-use
10
68
141
2023-11-02T18:22:11Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:High-use]]
wikitext
text/x-wiki
{{#invoke:High-use|main|1={{{1|}}}|2={{{2|}}}|info={{{info|}}}|demo={{{demo|}}}|form={{{form|}}}|expiry={{{expiry|}}}|system={{{system|}}}}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! -->
</noinclude>
a3322d1bd47ac03df14fa2090855cff4fede9bc7
Module:High-use
828
45
95
2023-11-02T18:22:12Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:High-use]]
Scribunto
text/plain
local p = {}
-- _fetch looks at the "demo" argument.
local _fetch = require('Module:Transclusion_count').fetch
local yesno = require('Module:Yesno')
function p.num(frame, count)
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
-- Build output string
local return_value = ""
if count == nil then
if frame.args[1] == "risk" then
return_value = "a very large number of"
else
return_value = "many"
end
else
-- Use 2 significant figures for smaller numbers and 3 for larger ones
local sigfig = 2
if count >= 100000 then
sigfig = 3
end
-- Prepare to round to appropriate number of sigfigs
local f = math.floor(math.log10(count)) - sigfig + 1
-- Round and insert "approximately" or "+" when appropriate
if (frame.args[2] == "yes") or (mw.ustring.sub(frame.args[1],-1) == "+") then
-- Round down
return_value = string.format("%s+", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )
else
-- Round to nearest
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
end
end
end
return return_value
end
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
local return_value = ""
if frame.args[1] == "risk" then
return_value = "risk"
else
local count = _fetch(frame)
if count and count >= 100000 then return_value = "risk" end
end
return return_value
end
function p.text(frame, count)
-- Only show the information about how this template gets updated if someone
-- is actually editing the page and maybe trying to update the count.
local bot_text = (frame:preprocess("{{REVISIONID}}") == "") and "\n\n----\n'''Preview message''': Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]])." or ''
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" or title.subpageText == "sandbox" then
title = title.basePageTitle
end
local systemMessages = frame.args['system']
if frame.args['system'] == '' then
systemMessages = nil
end
-- This retrieves the project URL automatically to simplify localiation.
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and ("''', and " .. templateCount) or ("'''"))
else
used_on_text = used_on_text .. templateCount .. "'''"
end
local sandbox_text = ("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. "):format(
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
mw.title.getCurrentTitle().namespace == 828 and "Module:Sandbox|module sandbox" or "Wikipedia:User pages#SUB|user subpage"
)
local infoArg = frame.args["info"] ~= "" and frame.args["info"]
if (systemMessages or frame.args[1] == "risk" or (count and count >= 100000) ) then
local info = systemMessages and '.<br/>Changes to it can cause immediate changes to the Wikipedia user interface.' or '.'
if infoArg then
info = info .. "<br />" .. infoArg
end
sandbox_text = info .. '<br /> To avoid major disruption' ..
(count and count >= 100000 and ' and server load' or '') ..
', any changes should be tested in the ' .. sandbox_text ..
'The tested changes can be added to this page in a single edit. '
else
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
'hanges may be widely noticed. Test changes in the ' .. sandbox_text
end
local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
else
discussion_text = string.format("%son the [[%s|talk page]]", discussion_text, title.talkPageTitle.fullText )
end
return used_on_text .. sandbox_text .. discussion_text .. " before implementing them." .. bot_text
end
function p.main(frame)
local count = nil
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
local type_param = "style"
local epilogue = ''
if frame.args['system'] and frame.args['system'] ~= '' then
image = "[[File:Ambox important.svg|40px|alt=Warning|link=]]"
type_param = "content"
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local categorise = (nocat == '' or not yesno(nocat))
if categorise then
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
end
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"
type_param = "content"
end
if frame.args["form"] == "editnotice" then
return frame:expandTemplate{
title = 'editnotice',
args = {
["image"] = image,
["text"] = p.text(frame, count),
["expiry"] = (frame.args["expiry"] or "")
}
} .. epilogue
else
return require('Module:Message box').main('ombox', {
type = type_param,
image = image,
text = p.text(frame, count),
expiry = (frame.args["expiry"] or "")
}) .. epilogue
end
end
return p
134551888e066954a89c109d2faa8af71a4454a4
Template:Template parameter usage
10
46
97
2023-11-02T18:22:12Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Template_parameter_usage]]
wikitext
text/x-wiki
{{#switch:{{{label|}}}
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|this template}} in articles{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|[[Template:{{ROOTPAGENAME}}]]}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|#default=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{{label|}}}]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
}}<noinclude>
{{documentation}}
</noinclude>
10a89e6a4bc63a1427518ea21bf94b8f623a7391
Template:TemplateData header
10
87
179
2023-11-02T18:22:12Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:TemplateData_header]]
wikitext
text/x-wiki
<div class="templatedata-header">{{#if:{{{noheader|}}}|<!--
noheader:
-->{{Template parameter usage|based=y}}|<!--
+header:
-->This is the {{#if:{{{nolink|}}}|<!--
+header, nolink TD
-->TemplateData|<!--
+header, +link [[TD]]; DEFAULT:
-->[[Wikipedia:TemplateData|TemplateData]]}}<!--
e.o. #if:nolink; DEFAULT:
--> for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools. {{Template parameter usage|based=y}}<!--
e.o. #if:noheader
-->}}
'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
</div><includeonly><!--
check parameters
-->{{#invoke:Check for unknown parameters|check
|unknown={{template other|1=[[Category:Pages using TemplateData header with unknown parameters|_VALUE_]]}}
|template=Template:TemplateData header
|1 |nolink |noheader
|preview=<div class="error" style="font-weight:normal">Unknown parameter '_VALUE_' in [[Template:TemplateData header]].</div>
}}<!--
-->{{template other|{{sandbox other||
[[Category:Templates using TemplateData]]
}}}}</includeonly><!--
--><noinclude>{{Documentation}}</noinclude>
ddfbb4ae793846b96d4c06330417fa6ed4da2adc
Module:Lua banner
828
49
103
2023-11-02T18:22:13Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Lua_banner]]
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
return box .. trackingCategories
end
function p.renderBox(modules)
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox.exists then
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText)
end
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" then
title = title.basePageTitle
end
if title.contentModel == "Scribunto" then
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
boxArgs.text = 'This template uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-Logo.svg|30px|alt=|link=]]'
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj)
if yesno(args.nocat) then
return ''
end
local cats = {}
-- Error category
if #modules < 1 then
cats[#cats + 1] = 'Lua templates with errors'
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
local subpageBlacklist = {
doc = true,
sandbox = true,
sandbox2 = true,
testcases = true
}
if not subpageBlacklist[titleObj.subpageText] then
local protCatName
if titleObj.namespace == 10 then
local category = args.category
if not category then
local categories = {
['Module:String'] = 'Templates based on the String Lua module',
['Module:Math'] = 'Templates based on the Math Lua module',
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
['Module:Citation/CS1'] = 'Templates based on the Citation/CS1 Lua module'
}
category = modules[1] and categories[modules[1]]
category = category or 'Lua-based templates'
end
cats[#cats + 1] = category
protCatName = "Templates using under-protected Lua modules"
elseif titleObj.namespace == 828 then
protCatName = "Modules depending on under-protected modules"
end
if not args.noprotcat and protCatName then
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
break
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
03ec1b34a40121efc562c0c64a67ebbf57d56dff
Module:Transclusion count
828
90
185
2023-11-02T18:22:13Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Transclusion_count]]
Scribunto
text/plain
local p = {}
function p.fetch(frame)
local template = nil
local return_value = nil
-- Use demo parameter if it exists, otherswise use current template name
local namespace = mw.title.getCurrentTitle().namespace
if frame.args["demo"] and frame.args["demo"] ~= "" then
template = mw.ustring.gsub(frame.args["demo"],"^[Tt]emplate:","")
elseif namespace == 10 then -- Template namespace
template = mw.title.getCurrentTitle().text
elseif namespace == 828 then -- Module namespace
template = (mw.site.namespaces[828].name .. ":" .. mw.title.getCurrentTitle().text)
end
-- If in template or module namespace, look up count in /data
if template ~= nil then
namespace = mw.title.new(template, "Template").namespace
if namespace == 10 or namespace == 828 then
template = mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end
template = mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end
local index = mw.ustring.sub(mw.title.new(template).text,1,1)
local status, data = pcall(function ()
return(mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other")))
end)
if status then
return_value = tonumber(data[mw.ustring.gsub(template, " ", "_")])
end
end
end
-- If database value doesn't exist, use value passed to template
if return_value == nil and frame.args[1] ~= nil then
local arg1=mw.ustring.match(frame.args[1], '[%d,]+')
if arg1 and arg1 ~= '' then
return_value = tonumber(frame:callParserFunction('formatnum', arg1, 'R'))
end
end
return return_value
end
-- Tabulate this data for [[Wikipedia:Database reports/Templates transcluded on the most pages]]
function p.tabulate(frame)
local list = {}
for i = 65, 91 do
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i)))
for name, count in pairs(data) do
table.insert(list, {mw.title.new(name, "Template").fullText, count})
end
end
table.sort(list, function(a, b)
return (a[2] == b[2]) and (a[1] < b[1]) or (a[2] > b[2])
end)
local lang = mw.getContentLanguage();
for i = 1, #list do
list[i] = ('|-\n| %d || [[%s]] || %s\n'):format(i, list[i][1]:gsub('_', ' '), lang:formatNum(list[i][2]))
end
return table.concat(list)
end
return p
000ef6bcbf7b66e727870b0c300c4009da300513
Module:Parameter names example
828
102
209
2023-11-02T18:22:13Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Parameter_names_example]]
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
--targs['nocat'] = 'yes';
--targs['categories'] = 'no';
--targs['demo'] = 'yes';
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
fdf94fb7a5dc1fabf118d60488a02f1e65b0df24
Template:Lua
10
48
101
2023-11-02T18:22:14Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Lua]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{Lua|Module:Lua banner}}
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
dba3962144dacd289dbc34f50fbe0a7bf6d7f2f7
Template:Parameter names example
10
96
197
2023-11-02T18:22:14Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Parameter_names_example]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{documentation}}<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
256a11b9ae7ac7e492b3d9de86ade1ffa96bffd1
Template:Microformat message
10
56
117
2023-11-02T18:22:15Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Microformat_message]]
wikitext
text/x-wiki
The [[Help:HTML in wikitext|HTML mark-up]] produced by this template includes {{#if:{{{type|}}} |{{{type}}} |an [[{{{format}}} microformat]]}} that makes {{{data}}} readily [[Parsing|parsable]] by computer programs. This aids tasks such as the cataloguing of articles and maintenance of databases. For more information about the use of microformats on Wikipedia, please visit [[Wikipedia:WikiProject Microformats|the Microformat WikiProject]].<!--
-->{{#if:{{{subtemplates<includeonly>|</includeonly>}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{large|Subtemplates}}
{{{subtemplates}}}
'''''Please do not remove instances of these subtemplates.'''''
</div>}}<!--
-->{{#if:{{{subsection1|}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;"><!--(newline in case subsection begins with heading:)-->
{{{subsection1}}}
</div>}}<!--
-->{{#if:{{{1<includeonly>|</includeonly>}}} <!--(i.e. if at least one unnamed parameter supplied:)-->
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{large|Classes used}}
The [[HTML attribute|HTML class]]es of this microformat include:
: {{hlist
|item_style=font-size:110%;{{{itemstyle|}}}
|{{{1}}} |{{{2<includeonly>|</includeonly>}}} |{{{3|<noinclude>{{nobold|โฆโฆ}}</noinclude>}}}
|{{{4|}}} |{{{5|}}} |{{{6|}}} |{{{7|}}} |{{{8|}}} |{{{9|}}} |{{{10|}}} |{{{11|}}} |{{{12|}}} |{{{13|}}} |{{{14|}}} |{{{15|}}} |{{{16|}}} |{{{17|}}} |{{{18|}}} |{{{19|}}} |{{{20|}}}
}} </div>
{{longitem|style=line-height:1.3em|'''''Please do not rename or remove these classes{{#if:{{{nocollapse<includeonly>|</includeonly>}}} |<br/>nor collapse nested elements which use them}}.'''''}}<!--
-->}}<!--(end #if:[1])--><noinclude>
{{Documentation}}
</noinclude>
25d8c54d56c1c64f1b98e6c8b2a50054e6a9deb5
Module:Transclusion count/data/I
828
91
187
2023-11-02T18:22:15Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Module:Transclusion_count/data/I]]
Scribunto
text/plain
return {
["IAAF_name"] = 2100,
["IAST"] = 6400,
["IBDB_name"] = 9100,
["ICD10"] = 4700,
["ICD9"] = 4400,
["ICS"] = 2900,
["IDN"] = 3400,
["IMDb_episode"] = 10000,
["IMDb_episodes"] = 2700,
["IMDb_name"] = 154000,
["IMDb_title"] = 190000,
["IMO_Number"] = 4100,
["IMSLP"] = 8300,
["INA"] = 2200,
["IND"] = 7700,
["INR"] = 6600,
["INRConvert"] = 5700,
["INRConvert/CurrentRate"] = 5600,
["INRConvert/USD"] = 5600,
["INRConvert/out"] = 5600,
["IOC_profile"] = 5000,
["IP"] = 2600,
["IPA"] = 143000,
["IPA-de"] = 8100,
["IPA-es"] = 7900,
["IPA-fr"] = 44000,
["IPA-it"] = 6000,
["IPA-nl"] = 3900,
["IPA-pl"] = 4100,
["IPA-pt"] = 3300,
["IPA-sl"] = 6900,
["IPA-th"] = 3000,
["IPA_audio_link"] = 3500,
["IPA_link"] = 3500,
["IPAc-cmn"] = 2300,
["IPAc-en"] = 48000,
["IPAc-pl"] = 51000,
["IPC_athlete"] = 2800,
["IPSummary"] = 78000,
["IP_summary"] = 79000,
["IPtalk"] = 18000,
["IPuser"] = 7100,
["IPvandal"] = 2700,
["IRC"] = 7300,
["IRI"] = 2300,
["IRL"] = 5500,
["IRN"] = 3700,
["ISBN"] = 462000,
["ISBN?"] = 2100,
["ISBNT"] = 39000,
["ISBN_missing"] = 2600,
["ISFDB_name"] = 4100,
["ISFDB_title"] = 4600,
["ISL"] = 2100,
["ISO_15924/script-example-character"] = 2800,
["ISO_15924/wp-article"] = 2800,
["ISO_15924/wp-article/format"] = 2800,
["ISO_15924/wp-article/label"] = 2700,
["ISO_3166_code"] = 521000,
["ISO_3166_name"] = 16000,
["ISO_639_name"] = 8200,
["ISP"] = 5300,
["ISR"] = 4900,
["ISSN"] = 12000,
["ISSN_link"] = 30000,
["ISTAT"] = 8100,
["ISU_figure_skater"] = 2500,
["ITA"] = 17000,
["ITF"] = 6300,
["ITF_profile"] = 9100,
["ITIS"] = 4400,
["ITN_talk"] = 10000,
["ITN_talk/date"] = 10000,
["IUCN_banner"] = 15000,
["I_sup"] = 4600,
["Iaaf_name"] = 7200,
["Ice_hockey"] = 19000,
["Ice_hockey_stats"] = 19000,
["Icehockeystats"] = 12000,
["Icon"] = 582000,
["If"] = 276000,
["If_all"] = 6500,
["If_between"] = 3800,
["If_both"] = 156000,
["If_empty"] = 3680000,
["If_first_display_both"] = 73000,
["If_in_page"] = 10000,
["If_last_display_both"] = 30000,
["If_preview"] = 58000,
["If_then_show"] = 293000,
["Ifempty"] = 4000,
["Ifeq"] = 17000,
["Iferror_then_show"] = 3300,
["Ifexist_not_redirect"] = 1310000,
["Ifnotempty"] = 15000,
["Ifnumber"] = 36000,
["Ifsubst"] = 450000,
["Ih"] = 7500,
["Ill"] = 120000,
["Illm"] = 6700,
["Image_frame"] = 4900,
["Image_label"] = 4500,
["Image_label_begin"] = 3800,
["Image_label_end"] = 3800,
["Image_label_small"] = 2600,
["Image_needed"] = 4500,
["Image_other"] = 272000,
["Image_requested"] = 168000,
["Image_requested/Category_helper"] = 160000,
["Imbox"] = 920000,
["Imdb_name"] = 5400,
["Imdb_title"] = 4000,
["Import_style"] = 11000,
["Import_style/inputbox.css"] = 11000,
["Importance"] = 5650000,
["Importance/colour"] = 5670000,
["Importance_mask"] = 10400000,
["Improve_categories"] = 7100,
["Improve_documentation"] = 2500,
["In_class"] = 5700,
["In_lang"] = 358000,
["In_progress"] = 3300,
["In_string"] = 76000,
["In_title"] = 19000,
["Inactive_userpage_blanked"] = 4900,
["Include-USGov"] = 29000,
["Incomplete_list"] = 23000,
["Inconclusive"] = 2100,
["Increase"] = 43000,
["Incumbent_pope"] = 4300,
["Indent"] = 4400,
["IndexFungorum"] = 2200,
["Indian_English"] = 4300,
["Indian_Rupee"] = 10000,
["Indian_railway_code"] = 3200,
["Inflation"] = 21000,
["Inflation-fn"] = 5400,
["Inflation-year"] = 4500,
["Inflation/IN/startyear"] = 5600,
["Inflation/UK"] = 4400,
["Inflation/UK/dataset"] = 4400,
["Inflation/UK/startyear"] = 4400,
["Inflation/US"] = 12000,
["Inflation/US-GDP"] = 2400,
["Inflation/US-GDP/dataset"] = 2400,
["Inflation/US-GDP/startyear"] = 2400,
["Inflation/US/dataset"] = 12000,
["Inflation/US/startyear"] = 12000,
["Inflation/fn"] = 6300,
["Inflation/year"] = 26000,
["Info"] = 7300,
["Infobox"] = 3240000,
["Infobox/Columns"] = 2400,
["Infobox/mobileviewfix.css"] = 147000,
["Infobox3cols"] = 17000,
["Infobox_AFL_biography"] = 14000,
["Infobox_Aircraft_Begin"] = 5300,
["Infobox_Aircraft_Type"] = 4700,
["Infobox_Athletics_Championships"] = 2700,
["Infobox_Australian_place"] = 15000,
["Infobox_CFL_biography"] = 2200,
["Infobox_COA_wide"] = 3200,
["Infobox_Canada_electoral_district"] = 2500,
["Infobox_Canadian_Football_League_biography"] = 5700,
["Infobox_Canadian_Football_League_biography/position"] = 5700,
["Infobox_Chinese"] = 20000,
["Infobox_Chinese/Chinese"] = 2700,
["Infobox_Chinese/Footer"] = 8700,
["Infobox_Chinese/Header"] = 8700,
["Infobox_Chinese/Korean"] = 17000,
["Infobox_Christian_leader"] = 18000,
["Infobox_French_commune"] = 38000,
["Infobox_GAA_player"] = 2700,
["Infobox_Gaelic_games_player"] = 5000,
["Infobox_German_location"] = 13000,
["Infobox_German_place"] = 14000,
["Infobox_Grand_Prix_race_report"] = 2000,
["Infobox_Greece_place"] = 2800,
["Infobox_Greek_Dimos"] = 2800,
["Infobox_Hindu_temple"] = 2400,
["Infobox_Indian_constituency"] = 4700,
["Infobox_Indian_constituency/defaultdata"] = 4700,
["Infobox_Italian_comune"] = 8100,
["Infobox_Korean_name"] = 15000,
["Infobox_Korean_name/categories"] = 15000,
["Infobox_MLB_yearly"] = 3100,
["Infobox_NASCAR_race_report"] = 2200,
["Infobox_NCAA_team_season"] = 17000,
["Infobox_NFL_biography"] = 28000,
["Infobox_NFL_player"] = 7600,
["Infobox_NFL_team_season"] = 3900,
["Infobox_NRHP"] = 72000,
["Infobox_NRHP/conv"] = 18000,
["Infobox_NRHP/locmapin2region"] = 66000,
["Infobox_Officeholder"] = 4800,
["Infobox_Olympic_event"] = 7300,
["Infobox_Olympic_event/games_text"] = 7300,
["Infobox_Paralympic_event"] = 2600,
["Infobox_Paralympic_event/games_text"] = 2600,
["Infobox_Politician"] = 2200,
["Infobox_Romanian_subdivision"] = 3200,
["Infobox_Russian_district"] = 2000,
["Infobox_Russian_inhabited_locality"] = 4500,
["Infobox_SCOTUS_case"] = 3700,
["Infobox_Site_of_Special_Scientific_Interest"] = 2000,
["Infobox_Swiss_town"] = 2800,
["Infobox_Switzerland_municipality"] = 2900,
["Infobox_Turkey_place"] = 19000,
["Infobox_U.S._county"] = 3000,
["Infobox_U.S._county/district"] = 3000,
["Infobox_UK_constituency"] = 2100,
["Infobox_UK_constituency/year"] = 2100,
["Infobox_UK_legislation"] = 3400,
["Infobox_UK_place"] = 26000,
["Infobox_UK_place/NoDialCode"] = 8100,
["Infobox_UK_place/NoPostCode"] = 3200,
["Infobox_UK_place/area"] = 2400,
["Infobox_UK_place/dist"] = 2500,
["Infobox_UK_place/local"] = 26000,
["Infobox_UK_place/styles.css"] = 26000,
["Infobox_UN_resolution"] = 2300,
["Infobox_US_Supreme_Court_case"] = 3800,
["Infobox_US_Supreme_Court_case/courts"] = 3800,
["Infobox_Wikipedia_user"] = 9800,
["Infobox_YouTube_personality"] = 2700,
["Infobox_YouTube_personality/styles.css"] = 2700,
["Infobox_academic"] = 14000,
["Infobox_aircraft_begin"] = 14000,
["Infobox_aircraft_occurrence"] = 2300,
["Infobox_aircraft_type"] = 13000,
["Infobox_airline"] = 4600,
["Infobox_airport"] = 15000,
["Infobox_airport/datatable"] = 15000,
["Infobox_album"] = 162000,
["Infobox_album/color"] = 192000,
["Infobox_album/link"] = 162000,
["Infobox_anatomy"] = 4500,
["Infobox_ancient_site"] = 5400,
["Infobox_animanga/Footer"] = 6800,
["Infobox_animanga/Header"] = 6900,
["Infobox_animanga/Print"] = 5500,
["Infobox_animanga/Video"] = 4700,
["Infobox_architect"] = 3700,
["Infobox_artist"] = 29000,
["Infobox_artist_discography"] = 5900,
["Infobox_artwork"] = 11000,
["Infobox_athlete"] = 2800,
["Infobox_automobile"] = 8400,
["Infobox_award"] = 13000,
["Infobox_badminton_player"] = 3200,
["Infobox_baseball_biography"] = 28000,
["Infobox_baseball_biography/style"] = 28000,
["Infobox_baseball_biography/styles.css"] = 28000,
["Infobox_basketball_biography"] = 21000,
["Infobox_basketball_biography/style"] = 21000,
["Infobox_basketball_club"] = 3000,
["Infobox_beauty_pageant"] = 2400,
["Infobox_bilateral_relations"] = 4400,
["Infobox_body_of_water"] = 18000,
["Infobox_book"] = 52000,
["Infobox_boxer"] = 5700,
["Infobox_bridge"] = 6000,
["Infobox_building"] = 27000,
["Infobox_character"] = 7500,
["Infobox_chess_biography"] = 4000,
["Infobox_chess_player"] = 3200,
["Infobox_church"] = 15000,
["Infobox_church/denomination"] = 15000,
["Infobox_church/font_color"] = 15000,
["Infobox_civil_conflict"] = 2400,
["Infobox_civilian_attack"] = 5500,
["Infobox_college_coach"] = 12000,
["Infobox_college_football_game"] = 2100,
["Infobox_college_football_player"] = 2000,
["Infobox_college_sports_team_season"] = 40000,
["Infobox_college_sports_team_season/link"] = 40000,
["Infobox_college_sports_team_season/name"] = 40000,
["Infobox_college_sports_team_season/succession"] = 40000,
["Infobox_college_sports_team_season/team"] = 40000,
["Infobox_comic_book_title"] = 3000,
["Infobox_comics_character"] = 3500,
["Infobox_comics_creator"] = 3500,
["Infobox_comics_creator/styles.css"] = 3500,
["Infobox_company"] = 83000,
["Infobox_computing_device"] = 2400,
["Infobox_concert"] = 3300,
["Infobox_constituency"] = 5400,
["Infobox_country"] = 6400,
["Infobox_country/formernext"] = 6000,
["Infobox_country/imagetable"] = 5200,
["Infobox_country/multirow"] = 8300,
["Infobox_country/status_text"] = 2800,
["Infobox_country/styles.css"] = 6500,
["Infobox_country_at_games"] = 15000,
["Infobox_country_at_games/core"] = 15000,
["Infobox_country_at_games/see_also"] = 12000,
["Infobox_court_case"] = 4700,
["Infobox_court_case/images"] = 2400,
["Infobox_cricket_tournament"] = 2300,
["Infobox_cricketer"] = 32000,
["Infobox_cricketer/career"] = 32000,
["Infobox_cricketer/national_side"] = 7500,
["Infobox_criminal"] = 6400,
["Infobox_curler"] = 2600,
["Infobox_cycling_race_report"] = 4500,
["Infobox_cyclist"] = 16000,
["Infobox_dam"] = 5700,
["Infobox_deity"] = 2000,
["Infobox_deity/color"] = 2000,
["Infobox_designation_list"] = 20000,
["Infobox_designation_list/entry"] = 17000,
["Infobox_dim"] = 7000,
["Infobox_dim/core"] = 7000,
["Infobox_diocese"] = 3800,
["Infobox_drug"] = 9800,
["Infobox_drug/chemical_formula"] = 9800,
["Infobox_drug/data_page_link"] = 9800,
["Infobox_drug/formatATC"] = 9700,
["Infobox_drug/formatCASnumber"] = 9800,
["Infobox_drug/formatChEBI"] = 9800,
["Infobox_drug/formatChEMBL"] = 9800,
["Infobox_drug/formatChemDBNIAID"] = 9800,
["Infobox_drug/formatChemSpider"] = 9800,
["Infobox_drug/formatCompTox"] = 9800,
["Infobox_drug/formatDrugBank"] = 9800,
["Infobox_drug/formatIUPHARBPS"] = 9800,
["Infobox_drug/formatJmol"] = 9800,
["Infobox_drug/formatKEGG"] = 9800,
["Infobox_drug/formatPDBligand"] = 9100,
["Infobox_drug/formatPubChemCID"] = 9800,
["Infobox_drug/formatPubChemSID"] = 9800,
["Infobox_drug/formatUNII"] = 9800,
["Infobox_drug/legal_status"] = 10000,
["Infobox_drug/licence"] = 9800,
["Infobox_drug/maintenance_categories"] = 9800,
["Infobox_drug/non-ref-space"] = 4300,
["Infobox_drug/pregnancy_category"] = 9800,
["Infobox_drug/title"] = 9800,
["Infobox_election"] = 30000,
["Infobox_election/row"] = 30000,
["Infobox_election/shortname"] = 28000,
["Infobox_enzyme"] = 5100,
["Infobox_ethnic_group"] = 7300,
["Infobox_event"] = 5400,
["Infobox_family"] = 2200,
["Infobox_figure_skater"] = 4200,
["Infobox_film"] = 157000,
["Infobox_film/short_description"] = 153000,
["Infobox_film_awards"] = 2600,
["Infobox_film_awards/link"] = 2600,
["Infobox_film_awards/style"] = 2600,
["Infobox_food"] = 6900,
["Infobox_football_biography"] = 207000,
["Infobox_football_club"] = 27000,
["Infobox_football_club_season"] = 20000,
["Infobox_football_league"] = 2600,
["Infobox_football_league_season"] = 20000,
["Infobox_football_match"] = 5900,
["Infobox_football_tournament_season"] = 8000,
["Infobox_former_subdivision"] = 3300,
["Infobox_former_subdivision/styles.css"] = 3300,
["Infobox_galaxy"] = 2100,
["Infobox_game"] = 2600,
["Infobox_game_score"] = 3400,
["Infobox_gene"] = 13000,
["Infobox_given_name"] = 4100,
["Infobox_golfer"] = 4400,
["Infobox_golfer/highest_ranking"] = 4400,
["Infobox_government_agency"] = 10000,
["Infobox_government_cabinet"] = 2600,
["Infobox_gridiron_football_person"] = 2400,
["Infobox_gridiron_football_person/position"] = 5700,
["Infobox_gymnast"] = 3500,
["Infobox_handball_biography"] = 4900,
["Infobox_historic_site"] = 12000,
["Infobox_horseraces"] = 2600,
["Infobox_hospital"] = 6300,
["Infobox_hospital/care_system"] = 6300,
["Infobox_hospital/lists"] = 6300,
["Infobox_ice_hockey_biography"] = 20000,
["Infobox_ice_hockey_player"] = 19000,
["Infobox_ice_hockey_team"] = 3000,
["Infobox_ice_hockey_team_season"] = 2000,
["Infobox_international_football_competition"] = 5800,
["Infobox_islands"] = 8900,
["Infobox_islands/area"] = 9300,
["Infobox_islands/density"] = 9300,
["Infobox_islands/length"] = 8900,
["Infobox_islands/styles.css"] = 8900,
["Infobox_journal"] = 9700,
["Infobox_journal/Abbreviation_search"] = 9600,
["Infobox_journal/Bluebook_check"] = 9400,
["Infobox_journal/Former_check"] = 9400,
["Infobox_journal/ISO_4_check"] = 9400,
["Infobox_journal/ISSN-eISSN"] = 9500,
["Infobox_journal/Indexing_search"] = 9500,
["Infobox_journal/MathSciNet_check"] = 9400,
["Infobox_journal/NLM_check"] = 9400,
["Infobox_journal/frequency"] = 8600,
["Infobox_lake"] = 4300,
["Infobox_language"] = 9500,
["Infobox_language/family-color"] = 11000,
["Infobox_language/genetic"] = 6600,
["Infobox_language/linguistlist"] = 9500,
["Infobox_language/ref"] = 7100,
["Infobox_legislature"] = 3700,
["Infobox_library"] = 2200,
["Infobox_lighthouse"] = 2600,
["Infobox_lighthouse/light"] = 2600,
["Infobox_locomotive"] = 4900,
["Infobox_magazine"] = 7600,
["Infobox_manner_of_address"] = 3300,
["Infobox_mapframe"] = 81000,
["Infobox_martial_artist"] = 5700,
["Infobox_martial_artist/record"] = 5700,
["Infobox_medal_templates"] = 424000,
["Infobox_medical_condition"] = 10000,
["Infobox_medical_condition_(new)"] = 8200,
["Infobox_medical_details"] = 2100,
["Infobox_military_conflict"] = 22000,
["Infobox_military_installation"] = 9800,
["Infobox_military_person"] = 45000,
["Infobox_military_unit"] = 26000,
["Infobox_mine"] = 2100,
["Infobox_model"] = 2300,
["Infobox_monument"] = 2000,
["Infobox_mountain"] = 28000,
["Infobox_multi-sport_competition_event"] = 2400,
["Infobox_museum"] = 10000,
["Infobox_musical_artist"] = 122000,
["Infobox_musical_artist/color"] = 122000,
["Infobox_musical_artist/hCard_class"] = 313000,
["Infobox_musical_composition"] = 2900,
["Infobox_name"] = 7500,
["Infobox_name_module"] = 7000,
["Infobox_newspaper"] = 9700,
["Infobox_nobility"] = 2400,
["Infobox_noble"] = 7400,
["Infobox_officeholder"] = 220000,
["Infobox_officeholder/office"] = 226000,
["Infobox_official_post"] = 8100,
["Infobox_organization"] = 36000,
["Infobox_pageant_titleholder"] = 2900,
["Infobox_park"] = 7500,
["Infobox_person"] = 476000,
["Infobox_person/Wikidata"] = 4700,
["Infobox_person/height"] = 103000,
["Infobox_person/length"] = 7000,
["Infobox_person/weight"] = 67000,
["Infobox_philosopher"] = 3400,
["Infobox_planet"] = 4700,
["Infobox_play"] = 3900,
["Infobox_political_party"] = 14000,
["Infobox_power_station"] = 3100,
["Infobox_prepared_food"] = 3100,
["Infobox_professional_wrestler"] = 4300,
["Infobox_professional_wrestling_event"] = 2700,
["Infobox_protected_area"] = 14000,
["Infobox_protein_family"] = 2100,
["Infobox_publisher"] = 2400,
["Infobox_racehorse"] = 5500,
["Infobox_racing_driver"] = 3900,
["Infobox_racing_driver_series_section"] = 2100,
["Infobox_radio_station"] = 22000,
["Infobox_rail"] = 2900,
["Infobox_rail_line"] = 7300,
["Infobox_rail_service"] = 3000,
["Infobox_rail_service/doc"] = 2900,
["Infobox_reality_competition_season"] = 3500,
["Infobox_record_label"] = 4000,
["Infobox_recurring_event"] = 6500,
["Infobox_religious_biography"] = 5300,
["Infobox_religious_building"] = 12000,
["Infobox_religious_building/color"] = 17000,
["Infobox_restaurant"] = 3000,
["Infobox_river"] = 30000,
["Infobox_river/calcunit"] = 30000,
["Infobox_river/discharge"] = 30000,
["Infobox_river/row-style"] = 30000,
["Infobox_river/source"] = 30000,
["Infobox_road"] = 24000,
["Infobox_road/meta/mask/category"] = 24000,
["Infobox_road/meta/mask/country"] = 24000,
["Infobox_road/styles.css"] = 25000,
["Infobox_road_small"] = 2300,
["Infobox_rockunit"] = 6500,
["Infobox_royalty"] = 22000,
["Infobox_royalty/short_description"] = 12000,
["Infobox_rugby_biography"] = 16000,
["Infobox_rugby_biography/correct_date"] = 16000,
["Infobox_rugby_biography/depcheck"] = 16000,
["Infobox_rugby_league_biography"] = 9900,
["Infobox_rugby_league_biography/PLAYER"] = 9800,
["Infobox_rugby_team"] = 2600,
["Infobox_sailboat_specifications"] = 2300,
["Infobox_saint"] = 5000,
["Infobox_school"] = 38000,
["Infobox_school/short_description"] = 38000,
["Infobox_school_district"] = 5700,
["Infobox_school_district/styles.css"] = 5700,
["Infobox_scientist"] = 48000,
["Infobox_service_record"] = 2600,
["Infobox_settlement"] = 562000,
["Infobox_settlement/areadisp"] = 238000,
["Infobox_settlement/columns"] = 95000,
["Infobox_settlement/columns/styles.css"] = 95000,
["Infobox_settlement/densdisp"] = 438000,
["Infobox_settlement/impus"] = 82000,
["Infobox_settlement/lengthdisp"] = 169000,
["Infobox_settlement/link"] = 95000,
["Infobox_settlement/metric"] = 211000,
["Infobox_settlement/pref"] = 293000,
["Infobox_settlement/styles.css"] = 562000,
["Infobox_ship_begin"] = 41000,
["Infobox_ship_career"] = 37000,
["Infobox_ship_characteristics"] = 41000,
["Infobox_ship_class_overview"] = 4100,
["Infobox_ship_image"] = 40000,
["Infobox_shopping_mall"] = 3500,
["Infobox_short_story"] = 2400,
["Infobox_skier"] = 2500,
["Infobox_soap_character"] = 2900,
["Infobox_software"] = 14000,
["Infobox_software/simple"] = 14000,
["Infobox_song"] = 76000,
["Infobox_song/color"] = 76000,
["Infobox_song/link"] = 76000,
["Infobox_spaceflight"] = 3600,
["Infobox_spaceflight/styles.css"] = 3600,
["Infobox_sport_event"] = 2200,
["Infobox_sports_competition_event"] = 18000,
["Infobox_sports_competition_event/medalrow"] = 12000,
["Infobox_sports_league"] = 5000,
["Infobox_sports_season"] = 5500,
["Infobox_sports_team"] = 2200,
["Infobox_sportsperson"] = 106000,
["Infobox_stadium"] = 3500,
["Infobox_station"] = 55000,
["Infobox_station/doc"] = 55000,
["Infobox_station/services"] = 55000,
["Infobox_station/styles.css"] = 55000,
["Infobox_street"] = 3400,
["Infobox_swimmer"] = 9400,
["Infobox_television"] = 57000,
["Infobox_television/Short_description"] = 54000,
["Infobox_television_channel"] = 6200,
["Infobox_television_episode"] = 12000,
["Infobox_television_episode/styles.css"] = 12000,
["Infobox_television_season"] = 9500,
["Infobox_television_station"] = 3700,
["Infobox_tennis_biography"] = 10000,
["Infobox_tennis_event"] = 2500,
["Infobox_tennis_tournament_event"] = 19000,
["Infobox_tennis_tournament_year"] = 9200,
["Infobox_tennis_tournament_year/color"] = 28000,
["Infobox_tennis_tournament_year/footer"] = 28000,
["Infobox_train"] = 2300,
["Infobox_union"] = 2100,
["Infobox_university"] = 26000,
["Infobox_user"] = 2700,
["Infobox_venue"] = 18000,
["Infobox_video_game"] = 28000,
["Infobox_video_game/styles.css"] = 28000,
["Infobox_volleyball_biography"] = 5400,
["Infobox_weapon"] = 7300,
["Infobox_weather_event"] = 2000,
["Infobox_weather_event/Footer"] = 2000,
["Infobox_weather_event/styles.css"] = 2000,
["Infobox_website"] = 7700,
["Infobox_writer"] = 39000,
["Information"] = 101000,
["Information/styles.css"] = 101000,
["Inline_block"] = 4600,
["Inprogress"] = 2400,
["Input_link"] = 32000,
["Instagram"] = 11000,
["Interlanguage_link"] = 157000,
["Interlanguage_link_multi"] = 19000,
["Internet_Archive_author"] = 19000,
["Internet_Archive_film"] = 2500,
["Intitle"] = 12000,
["Invalid_SVG"] = 3500,
["Invalid_SVG/styles.css"] = 3500,
["Iptalk"] = 17000,
["IranCensus2006"] = 46000,
["IranNCSGN"] = 3200,
["Iran_Census_2006"] = 46000,
["Irc"] = 2100,
["Irish_place_name"] = 2700,
["IsIPAddress"] = 37000,
["IsValidPageName"] = 142000,
["Is_country_in_Central_America"] = 13000,
["Is_country_in_the_Caribbean"] = 14000,
["Is_interwiki_link"] = 5900,
["Is_italic_taxon"] = 484000,
["Is_redirect"] = 27000,
["Isbn"] = 7600,
["Isfdb_name"] = 3700,
["Isfdb_title"] = 4400,
["Isnumeric"] = 142000,
["Iso2continent"] = 36000,
["Iso2country"] = 23000,
["Iso2country/article"] = 22000,
["Iso2country/data"] = 23000,
["Iso2nationality"] = 228000,
["Issubst"] = 72000,
["Isu_name"] = 2200,
["Italic_dab2"] = 5300,
["Italic_title"] = 282000,
["Italic_title_prefixed"] = 8700,
["Italics_colon"] = 3800,
["Italictitle"] = 4200,
["Ivm"] = 5700,
["Ivm/styles.css"] = 5700,
["Ivmbox"] = 123000,
["Ivory_messagebox"] = 143000,
["Module:I18n/complex_date"] = 66000,
["Module:IP"] = 132000,
["Module:IPA"] = 143000,
["Module:IPA/data"] = 128000,
["Module:IPA/styles.css"] = 114000,
["Module:IPA_symbol"] = 4800,
["Module:IPA_symbol/data"] = 4800,
["Module:IPAc-en"] = 48000,
["Module:IPAc-en/data"] = 48000,
["Module:IPAc-en/phonemes"] = 48000,
["Module:IPAc-en/pronunciation"] = 48000,
["Module:IPAddress"] = 188000,
["Module:ISO_3166"] = 1040000,
["Module:ISO_3166/data/AT"] = 2500,
["Module:ISO_3166/data/BA"] = 3400,
["Module:ISO_3166/data/CA"] = 2500,
["Module:ISO_3166/data/CN"] = 2100,
["Module:ISO_3166/data/DE"] = 14000,
["Module:ISO_3166/data/ES"] = 3600,
["Module:ISO_3166/data/FR"] = 38000,
["Module:ISO_3166/data/GB"] = 6400,
["Module:ISO_3166/data/GR"] = 3100,
["Module:ISO_3166/data/IN"] = 29000,
["Module:ISO_3166/data/IR"] = 9000,
["Module:ISO_3166/data/National"] = 1040000,
["Module:ISO_3166/data/PL"] = 6700,
["Module:ISO_3166/data/RS"] = 3200,
["Module:ISO_3166/data/RU"] = 25000,
["Module:ISO_3166/data/US"] = 85000,
["Module:ISO_639_name"] = 20000,
["Module:ISOdate"] = 66000,
["Module:Icon"] = 583000,
["Module:Icon/data"] = 583000,
["Module:If_empty"] = 3680000,
["Module:If_in_page"] = 10000,
["Module:If_preview"] = 297000,
["Module:If_preview/configuration"] = 297000,
["Module:If_preview/styles.css"] = 297000,
["Module:Import_style"] = 11000,
["Module:In_lang"] = 358000,
["Module:Indent"] = 4400,
["Module:Infobox"] = 4120000,
["Module:Infobox/dates"] = 69000,
["Module:Infobox/styles.css"] = 4380000,
["Module:Infobox3cols"] = 297000,
["Module:InfoboxImage"] = 4430000,
["Module:Infobox_body_of_water_tracking"] = 18000,
["Module:Infobox_cyclist_tracking"] = 16000,
["Module:Infobox_gene"] = 13000,
["Module:Infobox_mapframe"] = 406000,
["Module:Infobox_military_conflict"] = 22000,
["Module:Infobox_military_conflict/styles.css"] = 22000,
["Module:Infobox_multi-lingual_name"] = 20000,
["Module:Infobox_multi-lingual_name/data"] = 20000,
["Module:Infobox_power_station"] = 3100,
["Module:Infobox_road"] = 25000,
["Module:Infobox_road/browselinks"] = 25000,
["Module:Infobox_road/errors"] = 24000,
["Module:Infobox_road/length"] = 25000,
["Module:Infobox_road/locations"] = 24000,
["Module:Infobox_road/map"] = 25000,
["Module:Infobox_road/route"] = 25000,
["Module:Infobox_road/sections"] = 24000,
["Module:Infobox_television"] = 57000,
["Module:Infobox_television_disambiguation_check"] = 63000,
["Module:Infobox_television_episode"] = 12000,
["Module:Infobox_television_season_disambiguation_check"] = 9000,
["Module:Infobox_television_season_name"] = 9500,
["Module:Internet_Archive"] = 19000,
["Module:IrelandByCountyCatNav"] = 3400,
["Module:Is_infobox_in_lead"] = 378000,
["Module:Is_instance"] = 336000,
["Module:Italic_title"] = 1120000,
["Module:Italic_title2"] = 5300,
}
9332a4674f2c4134e2211474195b4ffb006598c0
Template:UF-hcal
10
101
207
2023-11-02T18:22:16Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:UF-hcal]]
wikitext
text/x-wiki
{{Microformat message
| format = hCalendar
| data = event details
| subtemplates =
{{#if:{{{hide_subtemplates}}} |<noinclude>}}
Dates will only be included if you use {{tl|start date}} (for single dates) or {{tl|end date}}. Do not, however, use these templates [[Wikipedia:WikiProject Microformats/dates|if a date before 1583 CE is involved]].
To include URLs, use {{tl|URL}}.
{{#if:{{{hide_subtemplates}}} |</noinclude>}}
|attendee |contact |description |dtend |dtstart |location |organiser |summary |url |vevent
| nocollapse = on
}}<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCalendars|{{PAGENAME}}]]}} }}</includeonly><noinclude>
{{Documentation |content={{Microformat message templates}}}}
[[Category:Microformat (uF) message templates]]
</noinclude>
f453b47f676a5c474e14155f7013b69b4716748b
Template:Campaignbox/doc
10
84
173
2023-11-02T18:22:17Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Campaignbox/doc]]
wikitext
text/x-wiki
{{#ifeq:{{{noheader|}}}|yes |
| {{Documentation subpage}}
{{Template display|nomobile}}
{{Template redirect|Campaign}}
{{Navbox visibility}}
== Usage ==
}}
{{#switch:{{ARTICLESPACE}}
| Wikipedia =
====Campaignboxes====
| #default =
===Campaignboxes===
}}
One common type of navigational template in articles concerning conflicts, wars and related topics is the '''campaignbox''' template, intended to provide context and convenient navigation among articles on the [[battles]] in a [[Military campaign|campaign]], [[Front (military)|front]], [[Theater (warfare)|theater]] or [[war]] (or, more rarely, among several campaigns or wars).
<div style="float:right;width:26.7em;margin-bottom:1.0em;">
{{Campaignbox Second Punic War}}
{{Campaignbox Punic Wars}}
</div>
If the article includes an [[Help:Infobox|infobox]], the campaignbox/es are usually placed immediately after it (i.e. just below it). If available, as with infoboxes such as {{tl|Infobox military conflict}}, use the infobox's {{para|campaignbox}} parameter:
<div style="width:25.0em;border:1px solid black;background:#ddd;padding:0.5em 1.0em;">
<syntaxhighlight lang="wikitext">
{{Infobox military conflict
...
}}
{{Campaignbox XXXX}}
</syntaxhighlight>or<syntaxhighlight lang="wikitext">
{{Infobox military conflict
...
| campaignbox = {{campaignbox XXXX}}
}}
</syntaxhighlight></div>
Articles may include multiple campaignboxes; typically, these are stacked under the infobox. The most common scenario occurs when two levels of campaignboxes are present โ for example, an article about a battle can include both a campaignbox listing the battle itself and an "enclosing" campaignbox listing the campaign, theater or war during which the battle took place. Similarly, an article about a war can include both a campaignbox listing the war (among a series of wars) and a campaignbox for the war itself, listing the battles that took place during it.
=== Creating campaignboxes ===
Existing campaignboxes may be viewed through the [[:Category:Campaignbox templates|Campaignbox template category]] to which campaignboxes are added automatically. If a new campaignbox becomes necessary, it should be named ''Template:Campaignbox XXXX'' (where XXXX is the (shortened) name of the campaign) and should use {{tlf|Campaignbox}} thus:
<div style="width:16.7em;border:1px solid black;background:#ddd;padding:0.5em 1.0em;">
<syntaxhighlight lang="wikitext">
{{Campaignbox
| name =
| title =
| battles =
| notes =
}}
</syntaxhighlight>
</div>
==== Parameters ====
; ''name'' : The name by which Wikipedia refers to the template, i.e. "Template:Campaignbox XXXX". This can be produced by using <code><nowiki>{{subst:PAGENAME}}</nowiki></code>.
; ''title'' : The name of the campaign or war, which, if an article about the campaign or war exists, should link to it. Dates should not be indicated unless needed for clarity. Note that long links may cause alignment problems; see [[WP:MILMOS#NAVPROBLEMS|the troubleshooting guide]] for more information.
; ''battles'' : A chronological list of battles and operations in the campaign, linked as <code><nowiki>[[Battle of YYYY|YYYY]]</nowiki></code>. A convenient and accessible way to separate the items in the list is to add <code>| listclass = hlist</code> and then use the standard <kbd>*</kbd> (asterisk)-based [[Help:List|listing format]].
; ''notes'' : (optional) Any explanatory notes needed to clarify the list. This option should be used sparingly.
; (''raw_name'') : (optional; deprecated) This parameter overrides the use of the title in determining the template name and exists for the sake of backward compatibility. When creating a new campaignbox, both title and name should be specified as above and this parameter omitted.
The following optional parameters are passed on to the templates {{tl|Military navigation}} or {{tl|Navbox}} used to create campaignboxes and so can affect their styling. See these two templates' documentation pages for further details.
; ''state'' : To set whether the campaignbox appears fully visible or collapsed (to titlebar only) when it is first presented by a page.
; ''bodyclass'' : CSS styling to affect the whole template.
; ''listclass'' : CSS styling to affect the list of battles, operations, etc. (e.g. to affect {{para|battles}}).
The use of special formatting (such as bolding or changes in font size) in the list of battles{{spaced ndash}}particularly to mark battles as "important"{{spaced ndash}}is generally discouraged; while there are a ''few'' cases where such approaches may be both helpful to the reader and sufficiently well-sourced that they do not constitute original research, they are usually both unnecessary and potentially confusing. Similarly, dividing the list of battles into multiple blocks by inserting heading-like separations should be exceptional; if such a division is felt to be needed, a better solution may be to split the one campaignbox into two or more.<noinclude>
[[Category:WikiProject Military history template instructions|Campaignbox]]
</noinclude><includeonly>{{Sandbox other||
[[Category:Campaignbox templates| ]]
{{#ifeq:{{{noheader|}}}|yes | |
[[Category:Navigational box wrapper templates]]
[[Category:Military navigational boxes|Campaignbox]]
[[Category:Templates that add a category]]
}}}}</includeonly>
05cb24dd8b2b1a78bab960db82b26ce0d68c3063
Template:Campaign/doc
10
83
171
2023-11-02T18:22:18Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Campaign/doc]]
wikitext
text/x-wiki
#REDIRECT [[Template:Campaignbox/doc]]
96204735bd25c964b25be72f9fe56c67b3302279
Template:Infobox military conflict/doc
10
106
217
2023-11-02T18:22:22Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Infobox_military_conflict/doc]]
wikitext
text/x-wiki
{{Documentation subpage}}
{{High-use|16,100}}
{{Lua|Module:Infobox military conflict}}
__TOC__
==Usage==
{{Infobox military conflict
| conflict = Battle of Lรผtzen
| partof = the [[Thirty Years' War]]
| image = Battle of Lutzen.jpg
| alt = Battle of Lutzen by Carl Whalbom depicting King Gustavus Aolphus falling from a horse mortally wounded in a melee
| image_size = 300px
| caption = The '' '''Battle of Lรผtzen''' '' by [[Carl Wahlbom]] shows the death of King [[Gustavus Adolphus]] on 16 November 1632.
| date = 6 November ([[Old Style and New Style dates|O.S.]]) or 16 November ([[Old Style and New Style dates|N.S.]]), 1632
| place = Near [[Lรผtzen]], southwest of [[Leipzig]]<br />(present-day [[Germany]])
| coordinates = {{coord|51|15|N|12|08|E|region:DE_type:city}}
| result = Protestant victory <br />(see {{blue|Aftermath}} section)
| combatant1 = {{flagicon|Sweden|1562}} [[Swedish Empire|Sweden]]<br />[[Protestant Union]]
| combatant2 = {{flag|Holy Roman Empire}}<br/>{{flagicon image|Catholic League (Germany).svg}} [[Catholic League (German)|Catholic League]]
| commander1 = {{flagicon|Sweden|1562}} [[Gustavus Adolphus]]{{KIA}}<br/>{{flagicon|Sweden|1562}} [[Dodo zu Innhausen und Knyphausen|Dodo von Knyphausen]]<br/>{{Flagicon|Electorate of Saxony}} [[Bernhard of Saxe-Weimar]]<br/>{{flagicon|Sweden|1562}} [[Robert Munro, 18th Baron of Foulis]]
| commander2 = {{flagicon|Holy Roman Empire}} [[Albrecht von Wallenstein]]<br/>{{flagicon|Holy Roman Empire}} [[Heinrich Holk]]<br/>{{flagicon|Holy Roman Empire}} [[Gottfried zu Pappenheim|Count Gottfried zu Pappenheim]]{{DOW}}
| strength1 = 12,800 infantry<br />6,200 cavalry<br />60 guns
| strength2 = 10,000 infantry<br />7,000 cavalry, plus 3,000 infantry and 2,000 cavalry on arrival<br />24 guns
| casualties1 = 3,400 dead and 1,600 wounded or missing
| casualties2 = Probably about the same as Swedish casualties{{fakeref|1}}
}}
A military conflict infobox (sometimes referred to as a warbox) may be used to summarize information about a particular military conflict (a battle, campaign, war, or group of related wars) in a standard manner.
Information summarized in an infobox should follow the general guidance for writing a [[Wikipedia:Manual of Style/Lead section|lead section]]. It should not "make claims" or present material not covered by the article. As with a lead section, there is some discretion in citing information in an infobox. The same guidance should be applied to an infobox as given for [[Wikipedia:Manual of Style/Lead section#Citations|citations in a lead section]]. Information in an infobox must conform with [[Wikipedia:Verifiability|verifiability]], [[Wikipedia:Neutral point of view|point-of-view]] and other policies.
Information in the infobox should not be "controversial". Refer the reader to an appropriate section in the article or leave the parameter blank rather than make an unsubstantiated or doubtful claim.
The infobox should be added using the {{tl|infobox military conflict}} template, as shown below:
<div style="width:250px;background:#dddddd;border: 1px solid black;padding:0.5em 1em 0.5em 1em"><syntaxhighlight lang="wikitext">
{{Infobox military conflict
| conflict =
| width =
| partof =
| image =
| image_size =
| alt =
| caption =
| date =
| place =
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result =
| status =
| combatants_header =
| combatant1 =
| combatant2 =
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 =
| strength2 =
| strength3 =
| casualties1 =
| casualties2 =
| casualties3 =
| notes =
| campaignbox =
}}
</syntaxhighlight></div>
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
===Parameters===
* '''conflict''' โ the name of the conflict being described (e.g. "Battle of Lรผtzen" or "World War I").
* '''width''' โ ''optional'' โ the width of the infobox, e.g. "400px"; defaults to: "315px".
* '''partof''' โ ''optional'' โ the larger conflict containing the event described in the article. For battles or campaigns, this should be the war during which the event takes place; for particularly large wars, this may include a theatre (e.g. "the Eastern Front of World War II"). For wars, the parameter may be used to link to a larger group of wars (e.g. the [[Italian War of 1521โ26]] to the [[Italian Wars]]). It may be necessary to insert "the" before the name of the war for proper grammar.
* '''image''' โ ''optional'' โ an image for the warbox. Given in the form <code>Example.jpg</code>
* '''image_size''' โ ''optional'' โ a size for the image
* '''alt''' โ ''optional'' โ [[Wikipedia:Manual of Style/Accessibility/Alternative text for images|Alternative text for image]] that is accessible to [[screen reader]]s to help the [[visually impaired]]
* '''caption''' โ ''optional'' โ the text to be placed below the image.
* '''date''' โ ''optional'' โ the date of the conflict described. Convention is to give the actual date for battles and the years for wars, but this does not always apply.
* '''place''' โ the location of the conflict. For conflicts covering a wide area, a general description (e.g. "France", or "Europe", or "Worldwide") may be used.
* '''coordinates''' – ''optional'' – the location of the structure, given as a coordinate pair by using {{tl|coord}} with ''display=inline,title''. Used to display the geographic location of the conflict and the location on a map added with the <code>map_type</code> parameter.
* '''map_type''' – ''optional'' – the base map to be used for the location map, e.g. "Scotland"; see {{tl|location map}} for more details.
* '''map_relief''' – ''optional'' – "yes" if the location map is a relief map; see {{tl|location map}} for more details.
* '''map_size''' – ''optional'' – width of the location map in pixels (px), e.g. "150"; defaults to: "220".
* '''map_mark''' – ''optional'' – the name of a file to use as the location map marker, e.g. Green_pog.svg; defaults to: "Red_pog.svg".
* '''map_marksize''' – ''optional'' – width of the location map marker in pixels (px), e.g. "10"; defaults to: "8".
* '''map_caption''' – ''optional'' – caption displayed below the location map; defaults to "Location within {{{map_type}}}", e.g. "Location within Scotland".
* '''map_label''' – ''optional'' – the label placed next to the marker on the location map.
* '''territory''' โ ''optional'' โ any changes in territorial control as a result of the conflict; this should not be used for overly lengthy descriptions of the peace settlement.
* '''action''' โ ''optional'' โ In case of Coup d'รtat, short description of ''modus operandi'', e.g. "...marched over the city...", "...dissolving the Congress of the Republic...", "...take the government hostage ...", "...put the country under military control ...", etc.
* '''result''' โ ''optional'' โ this parameter may use one of two standard terms: "X victory" or "Inconclusive". The term used is for the "immediate" outcome of the "subject" conflict and should reflect what the sources say. In cases where the standard terms do not accurately describe the outcome, a link or note should be made to the section of the article where the result is discussed in detail (such as "See the {{blue|Aftermath}} section"). Such a note can also be used in conjunction with the standard terms but should not be used to conceal an ambiguity in the "immediate" result. Do not introduce non-standard terms like "decisive", "marginal" or "tactical", or contradictory statements like "decisive tactical victory but strategic defeat". Omit this parameter altogether rather than engage in [[WP:NOR|speculation]] about which side won or by how much.
* '''status''' โ ''optional'' โ for ongoing conflicts, the current status of the conflict. This should not be used if a final result (above) is provided.
* '''combatants_header''' โ ''optional'' โ sets the header text for the combatants section. Default is "Belligerents". In case of Coup d'รtat, use "Government-Insurgents "
* '''combatant1'''/'''combatant2'''/'''combatant3''' โ ''optional'' โ the parties participating in the conflict. This is most commonly the countries whose forces took part in the conflict; however, larger groups (such as alliances or international organizations) or smaller ones (such as particular units, formations, or groups) may be indicated if doing so improves reader understanding. When there is a large number of participants, it may be better to list only the three or four major groups on each side of the conflict, and to describe the rest in the body of the article. The '''combatant3''' field may be used if a conflict has three distinct "sides", and should be left blank on other articles. Combatants should be listed in order of importance to the conflict, be it in terms of military contribution, political clout, or a recognized chain of command. If differing metrics can support alternative lists, then ordering is left to the editors of the particular article. The practice of writing in a "Supported by" subheading is deprecated (see [[Template talk:Infobox military conflict#RfC on "supported by" being used with the belligerent parameter|discussion]]).
** '''combatant1a'''/'''combatant2a'''/'''combatant3a''' โ ''optional'' โ in cases where the parties significantly changed over the course of the conflict, these subsidiary fields may be used to provide additional rows for the '''combatant''N''''' fields (above).
** '''combatant1b'''/'''combatant2b'''/'''combatant3b''' โ ''optional'' โ additional row, as above.
** '''combatant1c'''/'''combatant2c'''/'''combatant3c''' โ ''optional'' โ additional row, as above.
** '''combatant1d'''/'''combatant2d'''/'''combatant3d''' โ ''optional'' โ additional row, as above.
** '''combatant1e'''/'''combatant2e'''/'''combatant3e''' โ ''optional'' โ additional row, as above.
* '''commander1'''/'''commander2'''/'''commander3''' โ ''optional'' โ the commanders of the military forces involved. For battles, this should include military commanders (and other officers as necessary). For wars, only prominent or notable leaders should be listed, with an upper limit of about seven per combatant column recommended. Ranks and position titles should be omitted. The {{tl|KIA}} and {{tl|POW}} templates may be included immediately after the names of commanders who were killed in action or surrendered and were taken prisoner, respectively. The '''commander3''' field can only be used if the '''combatant3''' field is set.
** '''commander1a'''/'''commander2a'''/'''commander3a''' โ ''optional'' โ in cases where the commanders significantly changed over the course of the conflict, these subsidiary fields may be used to provide additional rows for the '''commander''N''''' fields (above).
** '''commander1b'''/'''commander2b'''/'''commander3b''' โ ''optional'' โ additional row, as above.
** '''commander1c'''/'''commander2c'''/'''commander3c''' โ ''optional'' โ additional row, as above.
** '''commander1d'''/'''commander2d'''/'''commander3d''' โ ''optional'' โ additional row, as above.
** '''commander1e'''/'''commander2e'''/'''commander3e''' โ ''optional'' โ additional row, as above.
* '''units1'''/'''units2'''/'''units3''' โ ''optional'' โ the units or formations involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field. The '''units3''' field can only be used if the '''combatant3''' field is set.
* '''strength1'''/'''strength2''' โ ''optional'' โ the numerical strength of the units involved.
:* '''polstrength1'''/'''polstrength2''' โ ''optional'' โ In case of Coup d'Etat, political organizations that supported the government (1) respective the insurgents (2).
:* '''milstrength1'''/'''milstrength2''' โ ''optional'' โ In case of Coup d'Etat, military units that supported the government (1) respective the insurgents (2).
* '''strength3''' โ ''optional'' โ if '''combatant3''' is set, this is a third strength field identical to the two above; if it is '''''not''''' set, this is an alternate combined field for use where only the total participation in a conflict is known.
* '''casualties1'''/'''casualties2''' โ ''optional'' โ casualties suffered (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Note that this section of the infobox is headed "Casualties and losses". Terms such as "dead" (or "killed"), "wounded", or "captured" should be used in place of abbreviations such as "KIA" or "POW". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.
* '''casualties3''' โ ''optional'' โ if '''combatant3''' is set, this is a third casualty field identical to the two above; if it is '''''not''''' set, this is an alternate combined field for use where only the total casualties of a conflict are known, or where civilian casualties cannot be directly attributed to either side.
* '''notes''' โ ''optional'' โ optional field for further notes; this should only be used in exceptional circumstances.
* '''campaignbox''' โ ''optional'' โ optional field for appending a [[WP:CAMPAIGN|campaignbox template]] to the bottom of the infobox, which allows both boxes to float as a single element (useful if there are subsequent left floating images, which would otherwise not be able to float above the campaign box); the template must be specified in the format <nowiki>{{Campaignbox XYZ}}</nowiki>.<noinclude>
[[Category:WikiProject Military history template instructions|Military conflict infobox]]
</noinclude>{{Campaign/doc|noheader=yes}}
{{Operational plan/doc|noheader=yes}}
==Microformat==
{{UF-hcal-geo}}
== TemplateData ==
{{TemplateData header}}
{{collapse top|title=TemplateData}}
<templatedata>
{
"description": "Summarize information about a particular military conflict (a battle, campaign, war, or group of related wars).",
"format": "{{_\n| _________________ = _\n}}\n",
"params": {
"conflict": {
"label": "Conflict",
"description": "The name of the conflict being described.",
"type": "string/line",
"required": true
},
"width": {
"label": "Width",
"description": "Width of the infobox.",
"type": "string",
"default": "315px",
"required": false
},
"partof": {
"label": "Part of",
"description": "The larger conflict containing the event described in the article.",
"type": "wiki-page-name",
"required": false
},
"image": {
"label": "Image",
"description": "An image for the warbox given in the form Example.jpg.",
"type": "wiki-file-name",
"required": false
},
"image_size": {
"label": "Image size",
"description": "The size of the image",
"type": "string",
"required": false
},
"alt": {
"label": "Alt",
"description": "Alternative textual description of the image",
"type": "string",
"required": false
},
"caption": {
"label": "Caption",
"description": "The text to be placed below the image.",
"type": "string",
"required": false
},
"date": {
"label": "Date",
"description": "The date of the conflict described. Convention is to give the actual date for battles and the years for wars, but this does not always apply.",
"type": "string",
"required": false
},
"place": {
"label": "Place",
"description": "The location of the conflict.",
"type": "string",
"required": true
},
"coordinates": {
"label": "Coordinates",
"description": "The location of the structure, given as a coordinate pair by using {{coord}} with display=inline,title.",
"type": "string",
"required": false
},
"map_type": {
"label": "Map Type",
"description": "The base map to be used for the location map, e.g. \"Scotland\"; see {{location map}} for more details.",
"type": "string",
"required": false
},
"map_relief": {
"label": "Map Relief",
"description": "\"yes\" if the location map is a relief map.",
"type": "string",
"required": false
},
"map_size": {
"label": "Map Size",
"description": "Width of the location map in pixels (px).",
"type": "number",
"default": "220",
"required": false
},
"map_mark": {
"label": "Map Marker",
"description": "File to use as the location map marker.",
"type": "string",
"default": "red_pog.svg",
"required": false
},
"map_marksize": {
"label": "Map Marker Size",
"description": "Width of the location map marker in pixels (px).",
"type": "number",
"default": "8",
"required": false
},
"map_caption": {
"label": "Map Caption",
"description": "Caption displayed below the location map.",
"type": "string",
"default": "Location within {{{map_type}}}",
"required": false
},
"map_label": {
"label": "Map Label",
"description": "The label placed next to the marker on the location map.",
"type": "string/line",
"required": false
},
"territory": {
"label": "Territory",
"description": "Any changes in territorial control as a result of the conflict; this should not be used for overly lengthy descriptions of the peace settlement.",
"type": "string",
"required": false
},
"result": {
"label": "Result",
"description": "This parameter may use one of two standard terms: \"X victory\" or \"Inconclusive\". The term used is for the \"immediate\" outcome of the \"subject\" conflict and should reflect what the sources say. In cases where the standard terms do not accurately describe the outcome, a link or note should be made to the section of the article where the result is discussed in detail (such as \"See the Aftermath section\"). Such a note can also be used in conjunction with the standard terms but should not be used to conceal an ambiguity in the \"immediate\" result. Do not introduce non-standard terms like \"decisive\", \"marginal\" or \"tactical\", or contradictory statements like \"decisive tactical victory but strategic defeat\". Omit this parameter altogether rather than engage in speculation about which side won or by how much.",
"type": "string",
"required": false
},
"status": {
"label": "Status",
"description": "For ongoing conflicts, the current status of the conflict.",
"type": "string/line",
"required": false
},
"combatants_header": {
"label": "\"Combatants\" Header Text",
"description": "Sets the header text for the combatants section.",
"type": "string/line",
"default": "Belligerents",
"required": false
},
"combatant1": {
"label": "Combatant 1",
"description": "A party participating in the conflict.",
"type": "string",
"required": false
},
"combatant2": {
"label": "Combatant 2",
"description": "A party participating in the conflict.",
"type": "string",
"required": false
},
"combatant3": {
"label": "Combatant 3",
"description": "A party participating in the conflict. (only if the conflict has three distinct \"sides\")",
"type": "string",
"required": false
},
"combatant1a": {
"label": "Combatant 1a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2a": {
"label": "Combatant 2a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3a": {
"label": "Combatant 3a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1b": {
"label": "Combatant 1b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2b": {
"label": "Combatant 2b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3b": {
"label": "Combatant 3b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1c": {
"label": "Combatant 1c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2c": {
"label": "Combatant 2c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3c": {
"label": "Combatant 3c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1d": {
"label": "Combatant 1d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2d": {
"label": "Combatant 2d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3d": {
"label": "Combatant 3d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"commander1": {
"label": "Commander of Combatant 1",
"description": "The commanders of the military forces of Combatant (1) involved.",
"type": "string",
"required": false
},
"commander2": {
"label": "Commander of Combatant 2",
"description": "The commanders of the military forces of Combatant 2 involved.",
"type": "string",
"required": false
},
"commander3": {
"label": "Commander of Combatant 3",
"description": "The commanders of the military forces of Combatant 3 involved.",
"type": "string",
"required": false
},
"units1": {
"label": "Units of Combatant 1",
"description": "The units or formations of Combatant 1 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"units2": {
"label": "Units of Combatant 2",
"description": "The units or formations of Combatant 2 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"units3": {
"label": "Units of Combatant 3",
"description": "The units or formations of Combatant 3 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"strength1": {
"label": "Strength of Combatant 1",
"description": "The numerical strength of Combatant 1.",
"type": "string",
"required": false
},
"strength2": {
"label": "Strength of Combatant 2",
"description": "The numerical strength of Combatant 2.",
"type": "string",
"required": false
},
"strength3": {
"label": "Strength of Combatant 3",
"description": "If Combatant 3 is set, this field is for the numerical strength of Combatant 3. If Combatant 3 is not set, this is an alternate combined field for use where only the total participation in a conflict is known.",
"type": "string",
"required": false
},
"casualties1": {
"label": "Casualties of Combatant 1",
"description": "Casualties suffered by Combatant 1 (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.",
"type": "string",
"required": false
},
"casualties2": {
"label": "Casualties of Combatant 2",
"description": "Casualties suffered by Combatant 2 (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.",
"type": "string",
"required": false
},
"casualties3": {
"label": "Casualties of Combatant 3",
"description": "If Combatant 3 is set, this field is for the casualties suffered by Combatant 3, (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc. If combatant3 is not set, this is an alternate combined field for use where only the total casualties of a conflict are known, or where civilian casualties cannot be directly attributed to either side.",
"type": "string",
"required": false
},
"notes": {
"label": "Notes",
"description": "Optional field for further notes; this should only be used in exceptional circumstances.",
"type": "string",
"required": false
},
"campaignbox": {
"label": "Campaignbox",
"description": "Optional field for appending a campaignbox template to the bottom of the infobox, which allows both boxes to float as a single element (useful if there are subsequent left floating images, which would otherwise not be able to float above the campaign box); the template must be specified in the format {{Campaignbox XYZ}}.",
"type": "string",
"required": false
}
}
}</templatedata>
{{Collapse bottom}}
==See also==
*{{tl|Infobox military operation}}
*{{tl|Infobox civil conflict}}
*{{tl|Infobox civilian attack}}
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:War and conflict infobox templates| ]]
[[Category:Templates based on the Infobox Lua module]]
}}</includeonly>
b7bc1bfd8830e6f3810fed38740c84ef509585dd
Template:Operational plan/doc
10
85
175
2023-11-02T18:22:24Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Operational_plan/doc]]
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox military operation/doc]]
10b255654acded6663dadad8d9084ba41f66bd68
Template:UF-hcal-geo
10
86
177
2023-11-02T18:22:24Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:UF-hcal-geo]]
wikitext
text/x-wiki
The HTML markup produced by this template includes an [[hCalendar|hCalendar microformat]], which makes the event details [[parsing|parsable]] by computers, either acting automatically to catalogue article across Wikipedia, or via a browser tool operated by a person, to (for example) add the subject to a calendar or diary application. Within the hCalendar is a [[Geo (microformat)|Geo microformat]], which additionally makes the [[geographic coordinate system|coordinates]] (latitude & longitude) parsable, so that they can be, say, looked up on a map, or downloaded to a [[Global Positioning System|GPS]] unit. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
Dates will only be included if you use {{tl|Start date}} or {{tl|End date}} (use the former for single dates, [[Wikipedia:WikiProject Microformats/dates|but do not use any of these if the date is before 1583 CE]]). {{tl|End date}} requires that a time be specified, but display of this time may be suppressed by adding {{para|nodate|yes}} to the end.
To include a URL, use {{tl|URL}}.
hCalendar uses HTML classes including:
{{Flatlist|indent=1|
*attendee
*dtend
*dtstart
*location
*summary
*url
*vevent
}}
Geo is produced by calling {{tl|coord}}, and uses HTML classes:
{{Flatlist|indent=1|
*geo
*latitude
*longitude
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''<br/>Also, when giving coordinates, please don't be [[wikipedia:WikiProject Geographical coordinates#Precision|overly precise]].
<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCalendars and Geo|{{PAGENAME}}]]}} }}</includeonly><noinclude>
[[Category:Microformat (uF) message templates]]
</noinclude>
17ca83a86600e9c6435d5e462efaadfbe2c34b4b
Template:Infobox military operation/doc
10
105
215
2023-11-02T18:22:24Z
infobox military conflict>Contributor 118,784
0
1 revision imported from [[:wikipedia:Template:Infobox_military_operation/doc]]
wikitext
text/x-wiki
{{#ifeq:{{{noheader|}}}|yes||{{Documentation subpage}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
}}
This infobox may be used to describe a particular planned or executed military operation or attack. For operations that resulted in combat, it can be used as an auxiliary template to the {{tl|infobox military conflict}}, if necessary; for other types of operations, including those that were planned but never executed, it may be used alone. In the case of conflicts that consisted of multiple independent operations, multiple copies of the box may be used on a single article.
__TOC__
=== Usage ===
{{Parameter names example|_template = Infobox military operation |title |name |partof |conflict |image |image_size |image_upright |alt |caption |coordinates = {{coord|0|0}} |map_type=Earth |map_size= |map_label |map_caption |scope |type |location |coordinates |planned |planned_by |commanded_by |target |objective |date |time |time-begin |time-end |timezone |executed_by |outcome |casualties |fatalities |injuries}}
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Infobox military operation
|name =
|partof =
|subtitle =
|image =
|image_upright =
|alt =
|caption =
|scope =
|type =
|location =
|location2 = <!-- 2 through 10 for more locations -->
|coordinates =
|coordinates2 = <!-- 2 through 10 for more locations -->
|map_type =
|map_size =
|map_caption =
|map_label =
|map_label2 = <!-- 2 through 10 for more locations -->
|planned =
|planned_by =
|commanded_by =
|objective =
|target =
|date = <!-- {{start date|YYYY|MM|DD|df=y}} -->
|time =
|time-begin =
|time-end =
|timezone =
|executed_by =
|outcome =
|casualties =
|fatalities =
|injuries =
}}</syntaxhighlight>
=== Example ===
{{Infobox military operation
|name = Case Blue
|scope = Strategic offensive
|planned_by = ''[[Wehrmacht]]''
|objective = Capture of [[Caucasus]] oil fields
|executed = Began {{start date|1942|06|28|df=y}}
|executed_by = [[Army Group South]]
}}
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Infobox military operation
|name = Case Blue
|scope = Strategic offensive
|planned_by = ''[[Wehrmacht]]''
|objective = Capture of [[Caucasus]] oil fields
|executed = Began {{start date|1942|06|28|df=y}}
|executed_by = [[Army Group South]]
}}</syntaxhighlight>
=== Parameters ===
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
* '''name''' โ the name of the operational plan; names in multiple languages may be provided.
* '''subtitle''' โ alternative name of the conflict being described.
* '''partof''' โ ''optional'' โ the larger conflict containing the event described in the article.
* '''image''' โ ''optional'' โ an image for the warbox. Given in the form <code>File:Example.jpg</code>
* '''image_upright''' โ ''optional'' โ image upright scaling factor.
* '''alt''' โ ''optional'' โ [[Wikipedia:Manual of Style/Accessibility/Alternative text for images|Alternative text for image]] that is accessible to [[screen reader]]s to help the [[visually impaired]]
* '''caption''' โ ''optional'' โ the text to be placed below the image.
* '''location''' โ ''optional'' โ the location of the operation.
* '''coordinates''' โ ''optional'' โ the coordinates for the location above, given as {{tl|coord}} with ''|display=inline,title''. Used to display the geographic location of the conflict and the location on a map added with the <code>map_type</code> parameter. If coordinates for several locations are given, consider if hany shall have the title display.
* '''map_type''' – ''optional'' – the base map to be used for the location map, e.g. "Scotland"; see {{tl|location map}} for more details.
* '''map_size''' – ''optional'' – width of the location map in pixels (px), e.g. "150"; defaults to: "220".
* '''map_caption''' – ''optional'' – caption displayed below the location map; defaults to "Location within {{{map_type}}}", e.g. "Location within Scotland".
* '''map_label''' – ''optional'' – the label placed next to the marker on the location map.
* '''scope''' โ ''optional'' โ the scope of the operation, such as "Strategic", "Operational", or "Tactical".
* '''type''' โ ''optional'' โ as an alternative to the '''scope''' field above, the type of operation, such as "Suicide attack" or "Ambush".
* '''planned''' โ ''optional'' โ the date(s) on which the plan was developed.
* '''planned_by''' โ ''optional'' โ the person or group responsible for developing the plan.
* '''commanded_by''' โ ''optional'' โ the person commanding the operation.
* '''objective''' โ ''optional'' โ the objective(s) of the operation.
* '''target''' โ ''optional'' โ as an alternative to the '''objective''' field above, the target(s) of the operation.
* '''date''' โ ''optional'' โ the date(s), if any, on which the operation was executed. use {{Tl|Start date}} (and {{Tl|End date}} if required)
* '''time''' โ ''optional'' โ the time, if any, at which the operation was executed.
* '''time-begin''' and '''time-end''' โ ''optional'' โ as an alternative to the '''time''' field above, the start and end times, respectively.
* '''timezone''' โ ''optional'' โ the timezone of the location of the operation; [[UTC]]+X, [[UTC]]-X, or [[UTC]] (i.e. offset from [[UTC]]) is preferred.
* '''executed_by''' โ ''optional'' โ the people, groups, units, or formations responsible for executing the operation.
* '''outcome''' โ ''optional'' โ the outcome of the operation from the perspective of the planners.
* '''casualties''' โ ''optional'' โ any casualties occurring during the execution of the operation.
* '''fatalities''' โ ''optional'' โ as an alternative to the '''casualties''' field above, the number of fatalities occurring during the execution of the operation.
* '''injuries''' โ ''optional'' โ as an alternative to the '''casualties''' field above, the number of injuries occurring during the execution of the operation.
=== Microformat ===
{{UF-hcal}}
=== TemplateData ===
{{collapse top|title=[[Wikipedia:TemplateData|TemplateData]] for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=y}}
<templatedata>
{
"description": "This infobox may be used to describe a particular planned or executed military operation or attack.",
"format": "{{_\n| _____________ = _\n}}\n",
"params": {
"name": {
"label": "Name",
"description": "The name of the military operation",
"type": "string",
"suggested": true
}
},
"paramOrder": [
"name"
]
}
</templatedata>
{{collapse bottom}}
=== See also ===
* {{tl|Infobox civil conflict}}
* {{tl|Infobox civilian attack}}
* {{tl|Infobox military conflict}}<noinclude>
[[Category:WikiProject Military history template instructions|Military operation]]
</noinclude>
<includeonly>
{{Sandbox other||{{#ifeq:{{{noheader|}}}|yes||
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:Templates with coordinates fields]]
[[Category:Military auxiliary infobox templates|Military operation]]
[[Category:Templates that add a tracking category|{{PAGENAME}}]]
}}}}</includeonly>
8e4979061f83f9af8d04b1f9f460ccb593e7d740
Main Page
0
1
1
2023-11-26T12:47:37Z
MediaWiki default
1
Create main page
wikitext
text/x-wiki
__NOTOC__
== Welcome to {{SITENAME}}! ==
This Main Page was created automatically and it seems it hasn't been replaced yet.
=== For the bureaucrat(s) of this wiki ===
Hello, and welcome to your new wiki! Thank you for choosing Miraheze for the hosting of your wiki, we hope you will enjoy our hosting.
You can immediately start working on your wiki or whenever you want.
Need help? No problem! We will help you with your wiki as needed. To start, try checking out these helpful links:
* [[mw:Special:MyLanguage/Help:Contents|MediaWiki guide]] (e.g. navigation, editing, deleting pages, blocking users)
* [[meta:Special:MyLanguage/FAQ|Miraheze FAQ]]
* [[meta:Special:MyLanguage/Request features|Request settings changes on your wiki]]. (Extensions, Skin and Logo/Favicon changes should be done through [[Special:ManageWiki]] on your wiki, see [[meta:Special:MyLanguage/ManageWiki|ManageWiki]] for more information.)
==== I still don't understand X! ====
Well, that's no problem. Even if something isn't explained in the documentation/FAQ, we are still happy to help you. You can find us here:
* [[meta:Special:MyLanguage/Help center|On our own Miraheze wiki]]
* On [[phab:|Phabricator]]
* On [https://miraheze.org/discord Discord]
* On IRC in #miraheze on irc.libera.chat ([irc://irc.libera.chat/%23miraheze direct link]; [https://web.libera.chat/?channel=#miraheze webchat])
=== For visitors of this wiki ===
Hello, the default Main Page of this wiki (this page) has not yet been replaced by the bureaucrat(s) of this wiki. The bureaucrat(s) might still be working on a Main Page, so please check again later!
21236ac3f8d65e5563b6da6b70815ca6bf1e6616
2
1
2023-11-27T12:47:05Z
WikiA3ro
2
Blanked the page
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
3
2
2023-11-27T12:49:44Z
WikiA3ro
2
wikitext
text/x-wiki
<center>
<noinclude> </noinclude>
'''<big>Welcome to GeoDiscover Wiki, the geotubing wiki!</big>'''</center>
<center><small>'''''{{SITENAME}} is currently running <span class="plainlinks">[http://www.mediawiki.org MediaWiki]</span> version {{CURRENTVERSION}}'''''</small></center>
320f26b2b4e63db020482fc0dd5c25053c15e41f
4
3
2023-11-27T12:50:24Z
WikiA3ro
2
wikitext
text/x-wiki
<center>
<noinclude> </noinclude>
'''<big>Welcome to GeoDiscover Wiki, the geotubing wiki!</big>'''</center>
<center><small>'''''{{SITENAME}} is currently running <span class="plainlinks">[http://www.mediawiki.org MediaWiki]</span> version {{CURRENTVERSION}}'''''</small></center>
==See also==
* [[Geotuber Ranking]]
* [[Geotuber Conflict]]
a2fb432e81e039543332ffadeaca297ba60007bd
Geotuber Ranking
0
2
5
2023-11-27T13:07:17Z
WikiA3ro
2
Created page with "[[Geotuber Ranking]] is a ranking of geotubers, around the world. It is calculated by a average rating. It is rated by quality,beat marking, edit time, and etc. Here is the list of the top geotubers: ==Ranking== {| class=wikitable |----- bgcolor="#efefef" ! Pos ! Geotuber ! Average Rating |- |----- | 1 ||๐ต๐ฐ IFS|| align="right" | 9.467 |----- |----- | 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.462 |----- |----- | 3 ||๐ธ๐ฆ SFF || align="right" | 9.461 |..."
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers, around the world. It is calculated by a average rating.
It is rated by quality,beat marking, edit time, and etc.
Here is the list of the top geotubers:
==Ranking==
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
|-----
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-----
|-----
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.462
|-----
|-----
| 3 ||๐ธ๐ฆ SFF || align="right" | 9.461
|-----
|-----
| 4 ||๐ต๐ฆ WILLY_NICX || align="right" | 9.460
|-----
|-----
| 5 ||๐ป๐ณ magball || align="right" | 9.455
|-----
|-----
| 6 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-----
|-----
| 7 ||๐ฎ๐ฑ CocoEditsMass|| align="right" | 9.450
|-----
|-----
| 8 ||๐ฎ๐ถ Underrated_Iraqi_Editz || align="right" | 9.448
|-----
|-----
| 9 ||๐น๐ญ Gabby_YT || align="right" | 9.446
|-----
|-----
| 10 ||๐ฐ๐ท KoreanWorldEdits|| align="right" | 9.443
|-----
|-----
| 11 ||๐ฉ๐ช RomilZerna || align="right" | 9.442
|-----
|-----
| 12 ||๐ซ๐ฎ Onlyflags6k || align="right" | 9.439
|-----
|-----
| 13 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.436
|-----
|-----
| 14 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-----
|-----
| 15 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.434
|-----
|-----
| 16 ||๐ต๐ฐ A3ro || align="right" | 9.430
|-----
|-----
| 17 ||๐ซ๐ท French_General || align="right" | 9.426
|-----
|-----
| 18 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-----
169c6f47e01354e725c9e9e3b58bac90f6d843ec
6
5
2023-11-27T13:10:10Z
WikiA3ro
2
/* Ranking */
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers, around the world. It is calculated by a average rating.
It is rated by quality,beat marking, edit time, and etc.
Here is the list of the top geotubers:
==Ranking==
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.462
|-
| 3 ||๐ธ๐ฆ SFF || align="right" | 9.461
|-
| 4 ||๐ต๐ฆ WILLY_NICX || align="right" | 9.460
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.455
|-
| 6 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-
| 7 ||๐ฎ๐ฑ CocoEditsMass|| align="right" | 9.450
|-
| 8 ||๐ฎ๐ถ Underrated_Iraqi_Editz || align="right" | 9.448
|-
| 9 ||๐น๐ญ Gabby_YT || align="right" | 9.446
|-
| 10 ||๐ฐ๐ท KoreanWorldEdits|| align="right" | 9.443
|-
| 11 ||๐ฉ๐ช RomilZerna || align="right" | 9.442
|-
| 12 ||๐ซ๐ฎ Onlyflags6k || align="right" | 9.439
|-
| 13 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.438
|-
| 14 ||๐ฉ๐ฐ Thatdanishcountryball|| align="right" | 9.436
|-
| 15 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 16 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 17 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 18 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 19 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
37afb46625005572b94d2ba65271690989eeb31d
10
6
2023-11-27T13:48:04Z
2605:8D80:62E:3733:C103:B87A:7DC2:65B0
0
/* Ranking */
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers, around the world. It is calculated by a average rating.
It is rated by quality,beat marking, edit time, and etc.
Here is the list of the top geotubers:
==Ranking==
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.462
|-
| 3 ||๐ธ๐ฆ SFF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.460
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.455
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.454
|-
| 7 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 8 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.448
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.446
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz|| align="right" | 9.443
|-
| 11 ||๐ฉ๐ช RomilZerna || align="right" | 9.442
|-
| 12 ||๐ฎ๐ถ Underrated Iraqi Edits|| align="right" | 9.439
|-
| 13 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.438
|-
| 14 ||๐ฉ๐ฐ Thatdanishcountryball|| align="right" | 9.436
|-
| 15 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 16 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 17 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 18 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 19 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
a96db3cd3eabf4afa82927406ec057920cea501f
11
10
2023-11-27T14:03:06Z
WikiA3ro
2
/* Ranking */
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers, around the world. It is calculated by a average rating.
It is rated by quality,beat marking, edit time, and etc.
Here is the list of the top geotubers:
==Ranking==
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.462
|-
| 3 ||๐ธ๐ฆ SFF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.460
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.455
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.454
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.448
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.446
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz|| align="right" | 9.443
|-
| 11 ||๐ฉ๐ช RomilZerna || align="right" | 9.442
|-
| 12 ||๐ฎ๐ถ Underrated Iraqi Edits|| align="right" | 9.439
|-
| 13 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.438
|-
| 14 ||๐ฉ๐ฐ Thatdanishcountryball|| align="right" | 9.436
|-
| 15 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 16 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 17 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 18 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 19 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
5f2dde1d1a346a5e71ca5e2cfb63223ccdabb459
12
11
2023-11-27T14:11:21Z
WikiA3ro
2
/* Ranking */
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers, around the world. It is calculated by a average rating.
It is rated by quality,beat marking, edit time, and etc.
Here is the list of the top geotubers:
==Ranking==
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.462
|-
| 3 ||๐ธ๐ฆ SFF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.460
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.455
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.454
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.448
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.446
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz|| align="right" | 9.443
|-
| 11 ||๐ฉ๐ช RomilZerna || align="right" | 9.442
|-
| 12 ||๐ฎ๐ถ Underrated Iraqi Edits|| align="right" | 9.439
|-
| 13 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.438
|-
| 14 ||๐ฉ๐ฐ Thatdanishcountryball|| align="right" | 9.436
|-
| 15 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 16 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 17 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 18 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 19 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
|-
| 20 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
72a638cdd0764fc595affcda69f59c1643439533
14
12
2023-11-27T14:20:40Z
WikiA3ro
2
Protected "[[Geotuber Ranking]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers, around the world. It is calculated by a average rating.
It is rated by quality,beat marking, edit time, and etc.
Here is the list of the top geotubers:
==Ranking==
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.462
|-
| 3 ||๐ธ๐ฆ SFF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.460
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.455
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.454
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.448
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.446
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz|| align="right" | 9.443
|-
| 11 ||๐ฉ๐ช RomilZerna || align="right" | 9.442
|-
| 12 ||๐ฎ๐ถ Underrated Iraqi Edits|| align="right" | 9.439
|-
| 13 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.438
|-
| 14 ||๐ฉ๐ฐ Thatdanishcountryball|| align="right" | 9.436
|-
| 15 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 16 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 17 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 18 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 19 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
|-
| 20 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
72a638cdd0764fc595affcda69f59c1643439533
15
14
2023-11-27T14:27:53Z
WikiA3ro
2
/* Ranking */
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers, around the world. It is calculated by a average rating.
It is rated by quality,beat marking, edit time, and etc.
Here is the list of the top geotubers:
==Ranking==
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.462
|-
| 3 ||๐ธ๐ฆ SFF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.460
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.455
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.454
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.448
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.446
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz|| align="right" | 9.443
|-
| 11 ||๐ฉ๐ช RomilZerna || align="right" | 9.442
|-
| 12 ||๐ฎ๐ถ Underrated Iraqi Edits|| align="right" | 9.439
|-
| 13 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.438
|-
| 14 ||๐ฉ๐ฐ Thatdanishcountryball|| align="right" | 9.436
|-
| 15 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 16 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 17 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 18 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 19 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
|-
| 20 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
|-
| 21 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
|-
| 22 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
|-
| 23 ||๐ต๐ฐ HexedGeography || align="right" | 9.413
|-
fd0414be0ceea58fff568ec0998c24ee4dc8821b
16
15
2023-11-27T14:37:41Z
WikiA3ro
2
/* Ranking */
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers, around the world. It is calculated by a average rating.
It is rated by quality,beat marking, edit time, and etc.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.462
|-
| 3 ||๐ธ๐ฆ SFF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.460
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.455
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.454
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.448
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.446
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz|| align="right" | 9.443
|-
| 11 ||๐ฉ๐ช RomilZerna || align="right" | 9.442
|-
| 12 ||๐ฎ๐ถ Underrated Iraqi Edits|| align="right" | 9.439
|-
| 13 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.438
|-
| 14 ||๐ฉ๐ฐ Thatdanishcountryball|| align="right" | 9.436
|-
| 15 ||๐ฆ๐ฒ ๐ฌ๐๐๐๐๐๐_๐ฐ๐๐๐๐ || align="right" | 9.436
|-
| 16 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 17 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 18 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 19 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 20 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
| 21 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
| 22 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 23 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
| 24 ||๐ต๐ฐ HexedGeography || align="right" | 9.413
|-
| 25 ||๐ต๐ฐ Moses || align="right" | 9.411
|-
f7784c07c18a91c92fbe36ba13f7a5a218ac2692
Talk:Geotuber Ranking
1
4
13
2023-11-27T14:20:34Z
WikiA3ro
2
Created page with "==if you want to add or change any rankings, discuss here!=="
wikitext
text/x-wiki
==if you want to add or change any rankings, discuss here!==
03a5f911235ed259d92341588abe6e3db7dd39ce
Geotuber Conflict
0
5
17
2023-11-27T15:02:55Z
WikiA3ro
2
Created page with "'''''if you want your wars, or want to add wars, please go to the discussion tab on this page.''''' A '''geotuber conflict''' is when two participants have a conflict, and they declare a war on each other. They bring their Allies and fight till they reach their main goals. One of the most famous rivarlies war were of non other than [[List of engagements between PYSEC and AWPT|PYSEC-AWPT Wars]], the two alliances are from Pakistan and India, which both countries in real..."
wikitext
text/x-wiki
'''''if you want your wars, or want to add wars, please go to the discussion tab on this page.'''''
A '''geotuber conflict''' is when two participants have a conflict, and they declare a war on each other. They bring their Allies and fight till they reach their main goals. One of the most famous rivarlies war were of non other than [[List of engagements between PYSEC and AWPT|PYSEC-AWPT Wars]], the two alliances are from Pakistan and India, which both countries in real life have a rivarly too<ref>https://en.wikipedia.org/wiki/India%E2%80%93Pakistan_relations</ref>
==Check out==
* [[List of engagements between PYSEC and AWPT|PYSEC-AWPT Wars]]
==References==
2e564501af776fb3c1a0228a20819ddd5406bd0a
Talk:Geotuber Conflict
1
6
18
2023-11-27T15:10:23Z
WikiA3ro
2
Created page with "Discuss here!"
wikitext
text/x-wiki
Discuss here!
50126cfae09169631c7455c3e1ebc8eb3ed1f858
Template:Infobox military conflict
10
7
20
19
2023-11-27T15:12:47Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Infobox military conflict|main}}</includeonly><noinclude>{{documentation}}</noinclude>
d340eca466eb5d0a69c1f4ac57d0f34d306ed031
Template:Documentation
10
8
22
21
2023-11-27T15:12:49Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Add categories to the /doc subpage -->
</noinclude>
9e62b964e96c4e3d478edecbfcb3c0338ae8a276
Module:String
828
9
24
23
2023-11-27T15:12:52Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters,
unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
automatically remove any leading or trailing whitespace from the parameter.
Depending on the intended use, it may be advantageous to either preserve or
remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in
an empty string being returned rather than an error message.
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String].
no_category: If set to 'true' or 1, no category will be added if an error
is generated.
Unit tests for this module are available at Module:String/tests.
]]
local str = {}
--[[
len
This function returns the length of the target string.
Usage:
{{#invoke:String|len|target_string|}}
OR
{{#invoke:String|len|s=target_string}}
Parameters
s: The string whose length to report
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string.
]]
function str.len( frame )
local new_args = str._getParameters( frame.args, {'s'} )
local s = new_args['s'] or ''
return mw.ustring.len( s )
end
--[[
sub
This function returns a substring of the target string at specified indices.
Usage:
{{#invoke:String|sub|target_string|start_index|end_index}}
OR
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
Parameters
s: The string to return a subset of
i: The first index of the substring to return, defaults to 1.
j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j
is a negative value, it is interpreted the same as selecting a character by
counting from the end of the string. Hence, a value of -1 is the same as
selecting the last character of the string.
If the requested indices are out of range for the given string, an error is
reported.
]]
function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } )
local s = new_args['s'] or ''
local i = tonumber( new_args['i'] ) or 1
local j = tonumber( new_args['j'] ) or -1
local len = mw.ustring.len( s )
-- Convert negatives for range checking
if i < 0 then
i = len + i + 1
end
if j < 0 then
j = len + j + 1
end
if i > len or j > len or i < 1 or j < 1 then
return str._error( 'String subset index out of range' )
end
if j < i then
return str._error( 'String subset indices out of order' )
end
return mw.ustring.sub( s, i, j )
end
--[[
This function implements that features of {{str sub old}} and is kept in order
to maintain these older templates.
]]
function str.sublength( frame )
local i = tonumber( frame.args.i ) or 0
local len = tonumber( frame.args.len )
return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
end
--[[
_match
This function returns a substring from the source string that matches a
specified pattern. It is exported for use in other modules
Usage:
strmatch = require("Module:String")._match
sresult = strmatch( s, pattern, start, match, plain, nomatch )
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This sub-routine is exported for use in other modules
function str._match( s, pattern, start, match_index, plain_flag, nomatch )
if s == '' then
return str._error( 'Target string is empty' )
end
if pattern == '' then
return str._error( 'Pattern string is empty' )
end
start = tonumber(start) or 1
if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
return str._error( 'Requested start is out of range' )
end
if match_index == 0 then
return str._error( 'Match index is out of range' )
end
if plain_flag then
pattern = str._escapePattern( pattern )
end
local result
if match_index == 1 then
-- Find first match is simple case
result = mw.ustring.match( s, pattern, start )
else
if start > 1 then
s = mw.ustring.sub( s, start )
end
local iterator = mw.ustring.gmatch(s, pattern)
if match_index > 0 then
-- Forward search
for w in iterator do
match_index = match_index - 1
if match_index == 0 then
result = w
break
end
end
else
-- Reverse search
local result_table = {}
local count = 1
for w in iterator do
result_table[count] = w
count = count + 1
end
result = result_table[ count + match_index ]
end
end
if result == nil then
if nomatch == nil then
return str._error( 'Match not found' )
else
return nomatch
end
else
return result
end
end
--[[
match
This function returns a substring from the source string that matches a
specified pattern.
Usage:
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
OR
{{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index
|match=match_number|plain=plain_flag|nomatch=nomatch_output}}
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from each string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then
this function generates an error. An error is also generated if no match is found.
If one adds the parameter ignore_errors=true, then the error will be suppressed and
an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This is the entry point for #invoke:String|match
function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} )
local s = new_args['s'] or ''
local start = tonumber( new_args['start'] ) or 1
local plain_flag = str._getBoolean( new_args['plain'] or false )
local pattern = new_args['pattern'] or ''
local match_index = math.floor( tonumber(new_args['match']) or 1 )
local nomatch = new_args['nomatch']
return str._match( s, pattern, start, match_index, plain_flag, nomatch )
end
--[[
pos
This function returns a single character from the target string at position pos.
Usage:
{{#invoke:String|pos|target_string|index_value}}
OR
{{#invoke:String|pos|target=target_string|pos=index_value}}
Parameters
target: The string to search
pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards
from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error.
]]
function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} )
local target_str = new_args['target'] or ''
local pos = tonumber( new_args['pos'] ) or 0
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
return str._error( 'String index out of range' )
end
return mw.ustring.sub( target_str, pos, pos )
end
--[[
str_find
This function duplicates the behavior of {{str_find}}, including all of its quirks.
This is provided in order to support existing templates, but is NOT RECOMMENDED for
new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based,
and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a
value of "1", which is generally unexpected behavior, and must be accounted for
separatetly.
]]
function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} )
local source_str = new_args['source'] or ''
local target_str = new_args['target'] or ''
if target_str == '' then
return 1
end
local start = mw.ustring.find( source_str, target_str, 1, true )
if start == nil then
start = -1
end
return start
end
--[[
find
This function allows one to search for a target string or pattern within another
string.
Usage:
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
OR
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
Parameters
source: The string to search
target: The string or pattern to find within source
start: The index within the source string to start the search, defaults to 1
plain: Boolean flag indicating that target should be understood as plain
text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the parameter. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found
within "source". Indices are 1-based. If "target" is not found, then this
function returns 0. If either "source" or "target" are missing / empty, this
function also returns 0.
This function should be safe for UTF-8 strings.
]]
function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['target'] or ''
local start_pos = tonumber(new_args['start']) or 1
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return 0
end
plain = str._getBoolean( plain )
local start = mw.ustring.find( source_str, pattern, start_pos, plain )
if start == nil then
start = 0
end
return start
end
--[[
replace
This function allows one to replace a target string or pattern within another
string.
Usage:
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
OR
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
count=replacement_count|plain=plain_flag}}
Parameters
source: The string to search
pattern: The string or pattern to find within source
replace: The replacement text
count: The number of occurences to replace, defaults to all.
plain: Boolean flag indicating that pattern should be understood as plain
text and not as a Lua style regular expression, defaults to true
]]
function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['pattern'] or ''
local replace = new_args['replace'] or ''
local count = tonumber( new_args['count'] )
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return source_str
end
plain = str._getBoolean( plain )
if plain then
pattern = str._escapePattern( pattern )
replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences.
end
local result
if count ~= nil then
result = mw.ustring.gsub( source_str, pattern, replace, count )
else
result = mw.ustring.gsub( source_str, pattern, replace )
end
return result
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] )
if not repetitions then
return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
return string.rep( frame.args[1] or '', repetitions )
end
--[[
escapePattern
This function escapes special characters from a Lua string pattern. See [1]
for details on how patterns work.
[1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
Usage:
{{#invoke:String|escapePattern|pattern_string}}
Parameters
pattern_string: The pattern string to escape.
]]
function str.escapePattern( frame )
local pattern_str = frame.args[1]
if not pattern_str then
return str._error( 'No pattern string specified' )
end
local result = str._escapePattern( pattern_str )
return result
end
--[[
count
This function counts the number of occurrences of one string in another.
]]
function str.count(frame)
local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'})
local source = args.source or ''
local pattern = args.pattern or ''
local plain = str._getBoolean(args.plain or true)
if plain then
pattern = str._escapePattern(pattern)
end
local _, count = mw.ustring.gsub(source, pattern, '')
return count
end
--[[
endswith
This function determines whether a string ends with another string.
]]
function str.endswith(frame)
local args = str._getParameters(frame.args, {'source', 'pattern'})
local source = args.source or ''
local pattern = args.pattern or ''
if pattern == '' then
-- All strings end with the empty string.
return "yes"
end
if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then
return "yes"
else
return ""
end
end
--[[
join
Join all non empty arguments together; the first argument is the separator.
Usage:
{{#invoke:String|join|sep|one|two|three}}
]]
function str.join(frame)
local args = {}
local sep
for _, v in ipairs( frame.args ) do
if sep then
if v ~= '' then
table.insert(args, v)
end
else
sep = v
end
end
return table.concat( args, sep or '' )
end
--[[
Helper function that populates the argument list given that user may need to use a mix of
named and unnamed parameters. This is relevant because named parameters are not
identical to unnamed parameters due to string trimming, and when dealing with strings
we sometimes want to either preserve or remove that whitespace depending on the application.
]]
function str._getParameters( frame_args, arg_list )
local new_args = {}
local index = 1
local value
for _, arg in ipairs( arg_list ) do
value = frame_args[arg]
if value == nil then
value = frame_args[index]
index = index + 1
end
new_args[arg] = value
end
return new_args
end
--[[
Helper function to handle error messages.
]]
function str._error( error_str )
local frame = mw.getCurrentFrame()
local error_category = frame.args.error_category or 'Errors reported by Module String'
local ignore_errors = frame.args.ignore_errors or false
local no_category = frame.args.no_category or false
if str._getBoolean(ignore_errors) then
return ''
end
local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>'
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str
end
return error_str
end
--[[
Helper Function to interpret boolean strings
]]
function str._getBoolean( boolean_str )
local boolean_value
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower()
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
or boolean_str == '' then
boolean_value = false
else
boolean_value = true
end
elseif type( boolean_str ) == 'boolean' then
boolean_value = boolean_str
else
error( 'No boolean value found' )
end
return boolean_value
end
--[[
Helper function that escapes all pattern characters so that they will be treated
as plain text.
]]
function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" )
end
return str
2ad0905c56ef4955950b75a8f00974fe82aed5e4
Module:List
828
10
26
25
2023-11-27T15:12:53Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes and TemplateStyles
data.classes = {}
data.templatestyles = ''
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Plainlist/styles.css' }
}
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for _, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for _, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for _, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return data.templatestyles .. tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
7a4f36a6e9cd56370bdd8207d23694124821dc1a
Module:Separated entries
828
11
28
27
2023-11-27T15:12:54Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
-- This module takes positional parameters as input and concatenates them with
-- an optional separator. The final separator (the "conjunction") can be
-- specified independently, enabling natural-language lists like
-- "foo, bar, baz and qux". The starting parameter can also be specified.
local compressSparseArray = require('Module:TableTools').compressSparseArray
local p = {}
function p._main(args)
local separator = args.separator
-- Decode (convert to Unicode) HTML escape sequences, such as " " for space.
and mw.text.decode(args.separator) or ''
local conjunction = args.conjunction and mw.text.decode(args.conjunction) or separator
-- Discard values before the starting parameter.
local start = tonumber(args.start)
if start then
for i = 1, start - 1 do args[i] = nil end
end
-- Discard named parameters.
local values = compressSparseArray(args)
return mw.text.listToText(values, separator, conjunction)
end
local function makeInvokeFunction(separator, conjunction, first)
return function (frame)
local args = require('Module:Arguments').getArgs(frame)
args.separator = separator or args.separator
args.conjunction = conjunction or args.conjunction
args.first = first or args.first
return p._main(args)
end
end
p.main = makeInvokeFunction()
p.br = makeInvokeFunction('<br />')
p.comma = makeInvokeFunction(mw.message.new('comma-separator'):plain())
return p
e80231ff3de01afd7f62a94e0a34dc1e67504085
Module:Infobox
828
12
30
29
2023-11-27T15:12:54Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local lists = {
plainlist_t = {
patterns = {
'^plainlist$',
'%splainlist$',
'^plainlist%s',
'%splainlist%s'
},
found = false,
styles = 'Plainlist/styles.css'
},
hlist_t = {
patterns = {
'^hlist$',
'%shlist$',
'^hlist%s',
'%shlist%s'
},
found = false,
styles = 'Hlist/styles.css'
}
}
local function has_list_class(args_to_check)
for _, list in pairs(lists) do
if not list.found then
for _, arg in pairs(args_to_check) do
for _, pattern in ipairs(list.patterns) do
if mw.ustring.find(arg or '', pattern) then
list.found = true
break
end
end
if list.found then break end
end
end
end
end
local function fixChildBoxes(sval, tt)
local function notempty( s ) return s and s:match( '%S' ) end
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- [[Special:Diff/849054481]]
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
-- Cleans empty tables
local function cleanInfobox()
root = tostring(root)
if has_rows == false then
root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
end
end
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class, args.headerclass })
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:tag('th')
:attr('colspan', '2')
:addClass('infobox-header')
:addClass(rowArgs.class)
:addClass(args.headerclass)
-- @deprecated next; target .infobox-<name> .infobox-header
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
if rowArgs.data then
root:wikitext(
'[[Category:Pages using infobox templates with ignored data cells]]'
)
end
elseif rowArgs.data and rowArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class })
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
-- @deprecated next; target .infobox-<name> .infobox-label
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
dataCell
:attr('colspan', not rowArgs.label and '2' or nil)
:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox(-full)-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
else
table.insert(empty_row_categories, rowArgs.data or '')
end
end
local function renderTitle()
if not args.title then return end
has_rows = true
has_list_class({args.titleclass})
root
:tag('caption')
:addClass('infobox-title')
:addClass(args.titleclass)
-- @deprecated next; target .infobox-<name> .infobox-title
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
has_rows = true
has_list_class({ args.aboveclass })
root
:tag('tr')
:tag('th')
:attr('colspan', '2')
:addClass('infobox-above')
:addClass(args.aboveclass)
-- @deprecated next; target .infobox-<name> .infobox-above
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
has_rows = true
has_list_class({ args.belowclass })
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-below')
:addClass(args.belowclass)
-- @deprecated next; target .infobox-<name> .infobox-below
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function addSubheaderRow(subheaderArgs)
if subheaderArgs.data and
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ subheaderArgs.rowclass, subheaderArgs.class })
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-subheader')
:addClass(subheaderArgs.class)
:cssText(subheaderArgs.datastyle)
:cssText(subheaderArgs.rowcellstyle)
:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
else
table.insert(empty_row_categories, subheaderArgs.data or '')
end
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addSubheaderRow({
data = args['subheader' .. tostring(num)],
-- @deprecated next; target .infobox-<name> .infobox-subheader
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function addImageRow(imageArgs)
if imageArgs.data and
imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_list_class({ imageArgs.rowclass, imageArgs.class })
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-image')
:addClass(imageArgs.class)
:cssText(imageArgs.datastyle)
:wikitext(fixChildBoxes(imageArgs.data, 'td'))
else
table.insert(empty_row_categories, imageArgs.data or '')
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:addClass('infobox-caption')
-- @deprecated next; target .infobox-<name> .infobox-caption
:cssText(args.captionstyle)
:wikitext(caption)
end
addImageRow({
data = tostring(data),
-- @deprecated next; target .infobox-<name> .infobox-image
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
if not args.autoheaders then return end
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local lastheader
for k, num in ipairs(rownums) do
if args['header' .. tostring(num)] then
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
lastheader = num
elseif args['data' .. tostring(num)] and
args['data' .. tostring(num)]:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
local data = args['data' .. tostring(num)]
if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
lastheader = nil
end
end
end
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
end
-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
-- @deprecated next; target .infobox-<name> rowclass
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-navbar')
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(require('Module:Italic title')._main({}))
end
end
-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
for _, s in ipairs(empty_row_categories) do
root:wikitext(s)
end
end
-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
if args.decat == 'yes' then return end
if args.child == 'yes' then
if args.title then
root:wikitext(
'[[Category:Pages using embedded infobox templates with the title parameter]]'
)
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles using infobox templates with no data rows]]')
end
end
--[=[
Loads the templatestyles for the infobox.
TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
local hlist_templatestyles = ''
if lists.hlist_t.found then
hlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.hlist_t.styles }
}
end
local plainlist_templatestyles = ''
if lists.plainlist_t.found then
plainlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.plainlist_t.styles }
}
end
-- See function description
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
}
local templatestyles = ''
if args['templatestyles'] then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] then
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
-- hlist -> plainlist -> base is best-effort to preserve old Common.css ordering.
-- this ordering is not a guarantee because the rows of interest invoking
-- each class may not be on a specific page
hlist_templatestyles,
plainlist_templatestyles,
base_templatestyles,
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()
renderImages()
preprocessRows()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderEmptyRowCategories()
renderTrackingCategories()
cleanInfobox()
end
-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
:addClass(args.bodyclass)
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
has_list_class({ args.bodyclass })
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
structure_infobox_common()
return loadTemplateStyles() .. root
end
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or
(v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present
-- and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
-- Do another loop if any arguments are found, even blank ones.
moreArgumentsExist = true
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present
-- and not blank, or we are processing "prefix1" and "prefix" is
-- present and not blank, and if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()
preprocessSingleArg('autoheaders')
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
-- different behaviour for italics if blank or absent
args['italic title'] = origArgs['italic title']
preprocessSingleArg('decat')
preprocessSingleArg('templatestyles')
preprocessSingleArg('child templatestyles')
preprocessSingleArg('grandchild templatestyles')
end
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
origArgs = {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
return p
0ddb7e5c8426d67cd589b710efb9912ddfb67fea
Module:If empty
828
13
32
31
2023-11-27T15:12:55Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
local p = {}
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
for k,v in ipairs(args) do
if v ~= '' then
return v
end
end
end
return p
4790391408957dea3ff9f453834c05f6b379a45c
Template:Yesno
10
14
34
33
2023-11-27T15:12:56Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|ยฌ}}} }}
|no
|n
|f
|false
|off
|0 = {{{no|<!-- null -->}}}
| = {{{blank|{{{no|<!-- null -->}}}}}}
|ยฌ = {{{ยฌ|}}}
|yes
|y
|t
|true
|on
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
629c2937bc5cf7cfe13cd2a598582af832782399
Module:Check for unknown parameters
828
15
36
35
2023-11-27T15:12:56Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
local function clean(text)
-- Return text cleaned for display and truncated if too long.
-- Strip markers are replaced with dummy text representing the original wikitext.
local pos, truncated
local function truncate(text)
if truncated then
return ''
end
if mw.ustring.len(text) > 25 then
truncated = true
text = mw.ustring.sub(text, 1, 25) .. '...'
end
return mw.text.nowiki(text)
end
local parts = {}
for before, tag, remainder in text:gmatch('([^\127]*)\127[^\127]*%-(%l+)%-[^\127]*\127()') do
pos = remainder
table.insert(parts, truncate(before) .. '<' .. tag .. '>...</' .. tag .. '>')
end
table.insert(parts, truncate(text:sub(pos or 1)))
return table.concat(parts)
end
function p._check(args, pargs)
if type(args) ~= "table" or type(pargs) ~= "table" then
-- TODO: error handling
return
end
-- create the list of known args, regular expressions, and the return string
local knownargs = {}
local regexps = {}
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
-- loop over the parent args, and make sure they are on the list
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local values = {}
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
table.insert(values, clean(k))
end
elseif type(k) == 'number' and knownargs[tostring(k)] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(tostring(k), regexp) then
knownflag = true
break
end
end
if not knownflag and ( showblankpos or isnotempty(v) ) then
table.insert(values, k .. ' = ' .. clean(v))
end
end
end
-- add results to the output tables
local res = {}
if #values > 0 then
local unknown_text = args['unknown'] or 'Found _VALUE_, '
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
local preview_text = args['preview']
if isnotempty(preview_text) then
preview_text = require('Module:If preview')._warning({preview_text})
elseif preview == nil then
preview_text = unknown_text
end
unknown_text = preview_text
end
for _, v in pairs(values) do
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
if v == '' then v = ' ' end
-- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
end
end
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
return p
93db6d115d4328d2a5148bb42959105e367b663e
Template:Main other
10
16
38
37
2023-11-27T15:12:57Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
</noinclude>
86ad907ffeea3cc545159e00cd1f2d6433946450
Template:Sandbox other
10
17
40
39
2023-11-27T15:12:57Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
91e4ae891d6b791615152c1fbc971414961ba872
Template:Collapse bottom
10
18
42
41
2023-11-27T15:12:58Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>|}</div></includeonly><noinclude>
{{Documentation|Template:Collapse top/doc}}
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
64b210e8ab0882b262da50e9fbccf2132bc34fab
Template:Abbr
10
19
44
43
2023-11-27T15:12:59Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<abbr {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} title="{{#tag:nowiki|{{#invoke:String|replace|{{{2|}}}|"|"}}}}">{{{1|}}}</abbr><noinclude>{{Documentation}}
</noinclude>
5fd53aa19ba927ce3eea9092a4fa31f881df0a6e
Module:Documentation
828
20
46
45
2023-11-27T15:12:59Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
local format = mw.ustring.format
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return format('[[%s|%s]]', page, display)
else
return format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return format(
'<span class="%s">(%s)</span>',
message('toolbar-class'),
table.concat(ret, ' | ')
)
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:attr('role', 'complementary')
:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)
:attr('aria-label', args.heading == '' and 'Documentation' or nil)
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.canonicalUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[File:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
-- 'module-sandbox-category' --> 'Module sandboxes'
-- 'other-sandbox-category' --> 'Sandboxes outside of template or module namespace'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype, sandboxCat
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
sandboxCat = message('sandbox-category')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
sandboxCat = message('module-sandbox-category')
else
pagetype = message('sandbox-notice-pagetype-other')
sandboxCat = message('other-sandbox-category')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(sandboxCat)
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
return {
title = title,
docTitle = docTitle,
-- View, display, edit, and purge links if /doc exists.
viewLinkDisplay = message('view-link-display'),
editLinkDisplay = message('edit-link-display'),
historyLinkDisplay = message('history-link-display'),
purgeLinkDisplay = message('purge-link-display'),
preload = preload,
createLinkDisplay = message('create-link-display')
}
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local docTitle = data.docTitle
-- yes, we do intend to purge the template page on which the documentation appears
local purgeLink = makeWikilink("Special:Purge/" .. data.title.prefixedText, data.purgeLinkDisplay)
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, data.editLinkDisplay)
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, data.historyLinkDisplay)
return "[" .. viewLink .. "] [" .. editLink .. "] [" .. historyLink .. "] [" .. purgeLink .. "]"
else
local createLink = makeUrlLink(docTitle:canonicalUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
return "[" .. createLink .. "] [" .. purgeLink .. "]"
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:attr('id', 'documentation-heading')
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local ret
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editDisplay = message('edit-link-display')
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, editDisplay)
local historyDisplay = message('history-link-display')
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:canonicalUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
.. '<br />'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeWikilink("Special:EditPage/" .. sandboxPage, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:canonicalUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeWikilink("Special:EditPage/" .. testcasesPage, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:canonicalUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
end
return ret
end
return p
0f0f558e631e573a8b022c2a20bfc47c4137d640
Module:Arguments
828
21
48
47
2023-11-27T15:13:00Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Documentation/config
828
22
50
49
2023-11-27T15:13:00Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category'] - A category to add to all template sandboxes.
-- cfg['module-sandbox-category'] - A category to add to all module sandboxes.
-- cfg['module-sandbox-category'] - A category to add to all sandboxe not in templates or modules.
cfg['sandbox-category'] = 'Template sandboxes'
cfg['module-sandbox-category'] = 'Module sandboxes'
cfg['other-sandbox-category'] = 'Sandboxes outside of template or module namespace'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Help:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
56b6127664e31128dea1cecf2e392cf9313df6a3
Template:Yes/no
10
23
52
51
2023-11-27T15:13:01Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Yesno]]
80e458cd4d851471d13896c26ecf96ce6dcdd579
Template:Infobox
10
24
54
53
2023-11-27T15:13:02Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
</noinclude>
817a9f5b6524eced06a57bd1d5fd7179f9369bf2
Template:WPMILHIST Infobox style
10
25
56
55
2023-11-27T15:13:02Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#switch:{{{1|}}}
|main_box=class="{{#if:{{{2|}}}|infobox {{{2}}}|infobox}}" style="{{#invoke:Data|Module:WPMILHIST Infobox style|main_box_raw}}"
|{{#invoke:Data|Module:WPMILHIST Infobox style|{{{1|}}}}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
b117547056afc703e2f1371497b0a53fa5a22751
Template:If empty
10
26
58
57
2023-11-27T15:13:02Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>{{Documentation}}</noinclude>
745940b7bdde8a1585c887ee4ee5ce81d98461a4
Template:Br separated entries
10
27
60
59
2023-11-27T15:13:03Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|br}}<noinclude>
{{documentation}}
</noinclude>
2019f7fc383259e70d66e43cbd97a43d20889f1b
Template:Template other
10
28
62
61
2023-11-27T15:13:03Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Template:Str left
10
29
64
63
2023-11-27T15:13:04Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{safesubst:padleft:|{{{2|1}}}|{{{1}}}}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
2048b0d7b35e156528655b1d090e8b5ffab3f400
Template:Remove first word
10
30
66
65
2023-11-27T15:13:04Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:String|replace|source={{{1}}}|pattern=^[^{{{sep|%s}}}]*{{{sep|%s}}}*|replace=|plain=false}}<noinclude>{{Documentation}}</noinclude>
df7a9e692f68be1581be06af5f51eaed5483b4c8
Module:Data
828
31
68
67
2023-11-27T15:13:05Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
local mt = {}
function mt.__index(t, k)
return function(frame)
local data = mw.loadData(k)
local i = 1
for _,v in ipairs(frame.args) do
local ty = type(data)
if ty ~= 'table' then
local args = {}
for j = 1, i - 1 do
args[j] = frame.args[j]
end
if frame.args.softfail then
return '<span class="error">[[Category:Pages with failed Module:Data lookups]]Error: Tried to read index "' .. mw.text.nowiki(v) .. '" of mw.loadData("' .. mw.text.nowiki(k) .. '").' .. mw.text.nowiki(table.concat(args, '.')) .. ', which is a ' .. ty .. '</span>'
else
error('Tried to read index "' .. v .. '" of mw.loadData("' .. k .. '").' .. table.concat(args, '.') .. ', which is a ' .. ty)
end
end
data = data[v]
i = i + 1
end
return data
end
end
return setmetatable({}, mt)
654c5ba2e0c73e7415457ca7a67fe0dfacfdba3b
Module:WPMILHIST Infobox style
828
32
70
69
2023-11-27T15:13:06Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
local retval = {
main_box_raw_auto_width = 'border-spacing:2px;',
header_raw = 'background-color:#C3D6EF;text-align:center;vertical-align:middle;font-size:110%;',
sub_header_raw = 'background-color:#DCDCDC;text-align:center;vertical-align:middle;',
header_color = 'background-color:#C3D6EF;',
nav_box = 'margin:0;float:right;clear:right;width:25.5em;margin-bottom:0.5em;margin-left:1em;',
nav_box_child = 'margin:0;float:right;clear:right;width:25em;margin-bottom:0.5em;',
nav_box_wide = '',
nav_box_header = 'background-color:#C3D6EF;',
nav_box_wide_header = 'background-color:#C3D6EF;',
nav_box_label = 'background-color:#DCDCDC;',
image_box_raw = 'text-align:center;border-bottom:1px solid #aaa;line-height:1.5em;',
image_box_plain_raw = 'text-align:center;line-height:1.5em;',
internal_border = '1px dotted #aaa;',
section_border = '1px solid #aaa;'
}
retval.main_box_raw = 'width:25.5em;' .. retval.main_box_raw_auto_width
retval.header_bar = 'style="' .. retval.header_raw .. '"'
retval.sub_header_bar = 'style="' .. retval.sub_header_raw .. '"'
retval.image_box = 'style="' .. retval.image_box_raw .. '"'
retval.image_box_plain = 'style="' .. retval.image_box_plain_raw .. '"'
return retval
0f9ea47bc17e40cdabbae6de54f63e40ae502f8e
Module:TableTools
828
33
72
71
2023-11-27T15:13:06Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should not --
-- be called directly from #invoke. --
------------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
function p.isPositiveInteger(v)
return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false if
-- not. Although it doesn't operate on tables, it is included here as it is useful
-- for determining whether a value can be a valid table key. Lua will generate an
-- error if a NaN is used as a table key.
------------------------------------------------------------------------------------
function p.isNan(v)
return type(v) == 'number' and v ~= v
end
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
function p.shallowClone(t)
checkType('shallowClone', 1, t, 'table')
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
function p.removeDuplicates(arr)
checkType('removeDuplicates', 1, arr, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for _, v in ipairs(arr) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will return
-- {1, 3, 6}.
------------------------------------------------------------------------------------
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like {"foo1", "bar1", "foo2", "baz2"}, returns a table
-- of subtables in the format
-- {[1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'}}.
-- Keys that don't end with an integer are stored in a subtable named "other". The
-- compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for _ in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
elseif type1 == 'table' or type1 == 'boolean' or type1 == 'function' then
return tostring(item1) < tostring(item2)
else
return item1 < item2
end
end
------------------------------------------------------------------------------------
-- keysToList
--
-- Returns an array of the keys in a table, sorted using either a default
-- comparison function or a custom keySort function.
------------------------------------------------------------------------------------
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, {'function', 'boolean', 'nil'})
end
local arr = {}
local index = 1
for k in pairs(t) do
arr[index] = k
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(arr, keySort)
end
return arr
end
------------------------------------------------------------------------------------
-- sortedPairs
--
-- Iterates through a table, with the keys sorted using the keysToList function.
-- If there are only numerical keys, sparseIpairs is probably more efficient.
------------------------------------------------------------------------------------
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local arr = p.keysToList(t, keySort, true)
local i = 0
return function ()
i = i + 1
local key = arr[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- isArray
--
-- Returns true if the given value is a table and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArray(v)
if type(v) ~= 'table' then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- isArrayLike
--
-- Returns true if the given value is iterable and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArrayLike(v)
if not pcall(pairs, v) then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- invert
--
-- Transposes the keys and values in an array. For example, {"a", "b", "c"} ->
-- {a = 1, b = 2, c = 3}. Duplicates are not supported (result values refer to
-- the index of the last duplicate) and NaN values are ignored.
------------------------------------------------------------------------------------
function p.invert(arr)
checkType("invert", 1, arr, "table")
local isNan = p.isNan
local map = {}
for i, v in ipairs(arr) do
if not isNan(v) then
map[v] = i
end
end
return map
end
------------------------------------------------------------------------------------
-- listToSet
--
-- Creates a set from the array part of the table. Indexing the set by any of the
-- values of the array returns true. For example, {"a", "b", "c"} ->
-- {a = true, b = true, c = true}. NaN values are ignored as Lua considers them
-- never equal to any value (including other NaNs or even themselves).
------------------------------------------------------------------------------------
function p.listToSet(arr)
checkType("listToSet", 1, arr, "table")
local isNan = p.isNan
local set = {}
for _, v in ipairs(arr) do
if not isNan(v) then
set[v] = true
end
end
return set
end
------------------------------------------------------------------------------------
-- deepCopy
--
-- Recursive deep copy function. Preserves identities of subtables.
------------------------------------------------------------------------------------
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[_deepCopy(orig_key, includeMetatable, already_seen)] = _deepCopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = _deepCopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
------------------------------------------------------------------------------------
-- sparseConcat
--
-- Concatenates all values in the table that are indexed by a number, in order.
-- sparseConcat{a, nil, c, d} => "acd"
-- sparseConcat{nil, b, c, d} => "bcd"
------------------------------------------------------------------------------------
function p.sparseConcat(t, sep, i, j)
local arr = {}
local arr_i = 0
for _, v in p.sparseIpairs(t) do
arr_i = arr_i + 1
arr[arr_i] = v
end
return table.concat(arr, sep, i, j)
end
------------------------------------------------------------------------------------
-- length
--
-- Finds the length of an array, or of a quasi-array with keys such as "data1",
-- "data2", etc., using an exponential search algorithm. It is similar to the
-- operator #, but may return a different value when there are gaps in the array
-- portion of the table. Intended to be used on data loaded with mw.loadData. For
-- other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of the number
-- of unnamed template parameters, so use this function for frame.args.
------------------------------------------------------------------------------------
function p.length(t, prefix)
-- requiring module inline so that [[Module:Exponential search]] which is
-- only needed by this one function doesn't get millions of transclusions
local expSearch = require("Module:Exponential search")
checkType('length', 1, t, 'table')
checkType('length', 2, prefix, 'string', true)
return expSearch(function (i)
local key
if prefix then
key = prefix .. tostring(i)
else
key = i
end
return t[key] ~= nil
end) or 0
end
------------------------------------------------------------------------------------
-- inArray
--
-- Returns true if valueToFind is a member of the array, and false otherwise.
------------------------------------------------------------------------------------
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
085e7094ac84eb0132ee65822cf3f69cd8ba3d81
Module:InfoboxImage
828
34
74
73
2023-11-27T15:13:06Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
-- Inputs:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
-- page - page to display for multipage images (DjVu)
-- size - size to display the image
-- maxsize - maximum size for image
-- sizedefault - default size to display the image if size param is blank
-- alt - alt text for image
-- title - title text for image
-- border - set to yes if border
-- center - set to yes, if the image has to be centered
-- upright - upright image param
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
-- link - page to visit when clicking on image
-- class - HTML classes to add to the image
-- Outputs:
-- Formatted image.
-- More details available at the "Module:InfoboxImage/doc" page
local i = {};
local placeholder_image = {
"Blue - Replace this image female.svg",
"Blue - Replace this image male.svg",
"Female no free image yet.png",
"Flag of None (square).svg",
"Flag of None.svg",
"Flag of.svg",
"Green - Replace this image female.svg",
"Green - Replace this image male.svg",
"Image is needed female.svg",
"Image is needed male.svg",
"Location map of None.svg",
"Male no free image yet.png",
"Missing flag.png",
"No flag.svg",
"No free portrait.svg",
"No portrait (female).svg",
"No portrait (male).svg",
"Red - Replace this image female.svg",
"Red - Replace this image male.svg",
"Replace this image female (blue).svg",
"Replace this image female.svg",
"Replace this image male (blue).svg",
"Replace this image male.svg",
"Silver - Replace this image female.svg",
"Silver - Replace this image male.svg",
"Replace this image.svg",
"Cricket no pic.png",
"CarersLogo.gif",
"Diagram Needed.svg",
"Example.jpg",
"Image placeholder.png",
"No male portrait.svg",
"Nocover-upload.png",
"NoDVDcover copy.png",
"Noribbon.svg",
"No portrait-BFD-test.svg",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Sin bandera.svg",
"Sin escudo.svg",
"Replace this image - temple.png",
"Replace this image butterfly.png",
"Replace this image.svg",
"Replace this image1.svg",
"Resolution angle.png",
"Image-No portrait-text-BFD-test.svg",
"Insert image here.svg",
"No image available.png",
"NO IMAGE YET square.png",
"NO IMAGE YET.png",
"No Photo Available.svg",
"No Screenshot.svg",
"No-image-available.jpg",
"Null.png",
"PictureNeeded.gif",
"Place holder.jpg",
"Unbenannt.JPG",
"UploadACopyrightFreeImage.svg",
"UploadAnImage.gif",
"UploadAnImage.svg",
"UploadAnImageShort.svg",
"CarersLogo.gif",
"Diagram Needed.svg",
"No male portrait.svg",
"NoDVDcover copy.png",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Noimage.gif",
}
function i.IsPlaceholder(image)
-- change underscores to spaces
image = mw.ustring.gsub(image, "_", " ");
assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')
-- if image starts with [[ then remove that and anything after |
if mw.ustring.sub(image,1,2) == "[[" then
image = mw.ustring.sub(image,3);
image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");
assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
-- capitalise first letter
image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
for i,j in pairs(placeholder_image) do
if image == j then
return true
end
end
return false
end
function i.InfoboxImage(frame)
local image = frame.args["image"];
if image == "" or image == nil then
return "";
end
if image == " " then
return image;
end
if frame.args["suppressplaceholder"] ~= "no" then
if i.IsPlaceholder(image) == true then
return "";
end
end
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then
return "";
end
if mw.ustring.sub(image,1,2) == "[[" then
-- search for thumbnail images and add to tracking cat if found
local cat = "";
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
cat = "[[Category:Pages using infoboxes with thumbnail images]]";
end
return image .. cat;
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then
return image;
elseif mw.ustring.sub(image,1,1) == "<" then
return image;
elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then
-- Found strip marker at begining, so pass don't process at all
return image;
elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then
-- Found strip marker at begining, so pass don't process at all
return image;
else
local result = "";
local page = frame.args["page"];
local size = frame.args["size"];
local maxsize = frame.args["maxsize"];
local sizedefault = frame.args["sizedefault"];
local alt = frame.args["alt"];
local link = frame.args["link"];
local title = frame.args["title"];
local border = frame.args["border"];
local upright = frame.args["upright"] or "";
local thumbtime = frame.args["thumbtime"] or "";
local center = frame.args["center"];
local class = frame.args["class"];
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
if maxsize ~= "" and maxsize ~= nil then
-- if no sizedefault then set to maxsize
if sizedefault == "" or sizedefault == nil then
sizedefault = maxsize
end
-- check to see if size bigger than maxsize
if size ~= "" and size ~= nil then
local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;
local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;
if sizenumber>maxsizenumber and maxsizenumber>0 then
size = maxsize;
end
end
end
-- add px to size if just a number
if (tonumber(size) or 0) > 0 then
size = size .. "px";
end
-- add px to sizedefault if just a number
if (tonumber(sizedefault) or 0) > 0 then
sizedefault = sizedefault .. "px";
end
result = "[[File:" .. image;
if page ~= "" and page ~= nil then
result = result .. "|page=" .. page;
end
if size ~= "" and size ~= nil then
result = result .. "|" .. size;
elseif sizedefault ~= "" and sizedefault ~= nil then
result = result .. "|" .. sizedefault;
else
result = result .. "|frameless";
end
if center == "yes" then
result = result .. "|center"
end
if alt ~= "" and alt ~= nil then
result = result .. "|alt=" .. alt;
end
if link ~= "" and link ~= nil then
result = result .. "|link=" .. link;
end
if border == "yes" then
result = result .. "|border";
end
if upright == "yes" then
result = result .. "|upright";
elseif upright ~= "" then
result = result .. "|upright=" .. upright;
end
if thumbtime ~= "" then
result = result .. "|thumbtime=" .. thumbtime;
end
if class ~= nil and class ~= "" then
result = result .. "|class=" .. class;
end
-- if alt value is a keyword then do not use as a description
if alt == "thumbnail" or alt == "thumb" or alt == "frameless" or alt == "left" or alt == "center" or alt == "right" or alt == "upright" or alt == "border" or mw.ustring.match(alt or "", '^[0-9]*px$', 1) ~= nil then
alt = nil;
end
if title ~= "" and title ~= nil then
-- does title param contain any templatestyles? If yes then set to blank.
if mw.ustring.match(frame:preprocess(title), 'UNIQ%-%-templatestyles', 1) ~= nil then
title = nil;
end
end
if title ~= "" and title ~= nil then
result = result .. "|" .. title;
end
result = result .. "]]";
return result;
end
end
return i;
0ee5fe75ba239fc5c9cedc81ca11bdc0be068542
Template:Campaignbox
10
35
76
75
2023-11-27T15:13:07Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{Military navigation
|name = {{#if:{{{raw_name|}}} |{{{raw_name|}}} |{{#if:{{{title|}}} |{{{name|}}} |}} }}
|state = {{{state|}}}
|border = {{{border|}}}
|title = <span style="line-height:1.6em">{{#if:{{{title|}}}|{{{title}}}|{{{name}}}}}</span>
|bodyclass = {{{bodyclass|}}}
|listclass = {{{listclass|}}}
|list1 = {{{battles|}}}
|below = {{{notes|}}}
}}{{#ifeq:{{NAMESPACE}}|Template|[[Category:Campaignbox templates]]}}</includeonly><noinclude>
{{documentation}}
</noinclude>
bd5acf07aa1526d63d10975ff20fe9d70de2f838
Template:Military navigation
10
36
78
77
2023-11-27T15:13:07Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Military navigation|main}}</includeonly><noinclude>
{{Documentation|Wikipedia:WikiProject Military history/Military navigation}}
{{Sandbox other||
[[Category:Navigational box wrapper templates]]
[[Category:Military navigational boxes| ]]
}}</noinclude>
10eb2cd55540aab60dd8603c113e21995e9bb545
Module:Military navigation
828
37
80
79
2023-11-27T15:13:08Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
local p = { }
local Navbox = require('Module:Navbox')
local Styles = require('Module:WPMILHIST Infobox style')
local function isblank(s)
return (not s) or s == ''
end
local function isnotblank(s)
return s and s ~= ''
end
function p.main(frame)
local args = { }
local pargs = frame:getParent().args
local sargs = {}
local tcats = ''
-- process bodystyle and titlestyle
if (pargs['style'] or '') == 'wide' then
args['titlestyle'] = Styles['nav_box_wide_header']
args['bodystyle'] = Styles['nav_box_wide']
else
args['titlestyle'] = Styles['nav_box_header']
if (pargs['border'] or '') == 'child' or
(pargs['border'] or '') == 'subgroup' then
args['bodystyle'] = Styles['nav_box_child']
tcats = tcats .. '[[Category:Pages using military navigation subgroups without wide style]]'
else
args['bodystyle'] = Styles['nav_box']
end
end
sargs['titlestyle'] = 1
sargs['bodystyle'] = 1
-- process groupstyle, abovestyle, belowstyle
args['groupstyle'] = Styles['nav_box_label'] .. (pargs['groupstyle'] or '')
sargs['groupstyle'] = 1
args['abovestyle'] = Styles['nav_box_label'] .. (pargs['abovestyle'] or '')
sargs['abovestyle'] = 1
args['belowstyle'] = Styles['nav_box_label'] .. (pargs['belowstyle'] or '')
sargs['belowstyle'] = 1
-- process oddstyle, evenstyle
args['oddstyle'] = isnotblank(pargs['odd_color'])
and ('background:' .. pargs['odd_color']) or nil
sargs['oddstyle'] = 1
args['evenstyle'] = isnotblank(pargs['even_color'])
and ('background:' .. pargs['even_color']) or nil
sargs['evenstyle'] = 1
-- process name and rawname
args['name'] = (isnotblank(pargs['name']) and pargs['name']) or pargs['rawname']
if isblank(args['name']) then args['navbar'] = 'plain' end
sargs['name'] = 1
sargs['rawname'] = 1
-- copy the remaining args
for k, v in pairs(pargs) do
if v and v ~= '' and sargs[k] == nil then
args[k] = v
end
end
-- add allow wrap
if args['title'] and (pargs['style'] or '') ~= 'wide' then
if not mw.ustring.match(args['title'], '<span class="wrap">') then
-- probably a more efficient way to match 15 or more characters
local m = '[^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|]'
m = m .. m .. m
args['title'] = mw.ustring.gsub(args['title'],
'%[%[(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%1</span>]]')
args['title'] = mw.ustring.gsub(args['title'],
'%[%[([^%[%]<>|]*)|(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%2</span>]]')
end
end
-- add navbox-vertical for non-wide format
if (pargs['style'] or '') ~= 'wide' then
args['bodyclass'] = 'navbox-vertical' .. (args['bodyclass'] and (' ' .. args['bodyclass']) or '')
end
return tcats .. Navbox._navbox(args)
end
return p
26dd1b8952c65fbc4d05e418e8d7c3daed93fa49
Module:Navbox
828
38
82
81
2023-11-27T15:13:08Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
require('strict')
local p = {}
local navbar = require('Module:Navbar')._navbar
local cfg = mw.loadData('Module:Navbox/configuration')
local getArgs -- lazily initialized
local args
local format = string.format
local function striped(wikitext, border)
-- Return wikitext with markers replaced for odd/even striping.
-- Child (subgroup) navboxes are flagged with a category that is removed
-- by parent navboxes. The result is that the category shows all pages
-- where a child navbox is not contained in a parent navbox.
local orphanCat = cfg.category.orphan
if border == cfg.keyword.border_subgroup and args[cfg.arg.orphan] ~= cfg.keyword.orphan_yes then
-- No change; striping occurs in outermost navbox.
return wikitext .. orphanCat
end
local first, second = cfg.class.navbox_odd_part, cfg.class.navbox_even_part
if args[cfg.arg.evenodd] then
if args[cfg.arg.evenodd] == cfg.keyword.evenodd_swap then
first, second = second, first
else
first = args[cfg.arg.evenodd]
second = first
end
end
local changer
if first == second then
changer = first
else
local index = 0
changer = function (code)
if code == '0' then
-- Current occurrence is for a group before a nested table.
-- Set it to first as a valid although pointless class.
-- The next occurrence will be the first row after a title
-- in a subgroup and will also be first.
index = 0
return first
end
index = index + 1
return index % 2 == 1 and first or second
end
end
local regex = orphanCat:gsub('([%[%]])', '%%%1')
return (wikitext:gsub(regex, ''):gsub(cfg.marker.regex, changer)) -- () omits gsub count
end
local function processItem(item, nowrapitems)
if item:sub(1, 2) == '{|' then
-- Applying nowrap to lines in a table does not make sense.
-- Add newlines to compensate for trim of x in |parm=x in a template.
return '\n' .. item ..'\n'
end
if nowrapitems == cfg.keyword.nowrapitems_yes then
local lines = {}
for line in (item .. '\n'):gmatch('([^\n]*)\n') do
local prefix, content = line:match('^([*:;#]+)%s*(.*)')
if prefix and not content:match(cfg.pattern.nowrap) then
line = format(cfg.nowrap_item, prefix, content)
end
table.insert(lines, line)
end
item = table.concat(lines, '\n')
end
if item:match('^[*:;#]') then
return '\n' .. item ..'\n'
end
return item
end
local function has_navbar()
return args[cfg.arg.navbar] ~= cfg.keyword.navbar_off
and args[cfg.arg.navbar] ~= cfg.keyword.navbar_plain
and (
args[cfg.arg.name]
or mw.getCurrentFrame():getParent():getTitle():gsub(cfg.pattern.sandbox, '')
~= cfg.pattern.navbox
)
end
local function renderNavBar(titleCell)
if has_navbar() then
titleCell:wikitext(navbar{
[cfg.navbar.name] = args[cfg.arg.name],
[cfg.navbar.mini] = 1,
[cfg.navbar.fontstyle] = (args[cfg.arg.basestyle] or '') .. ';' ..
(args[cfg.arg.titlestyle] or '') ..
';background:none transparent;border:none;box-shadow:none;padding:0;'
})
end
end
local function renderTitleRow(tbl)
if not args[cfg.arg.title] then return end
local titleRow = tbl:tag('tr')
local titleCell = titleRow:tag('th'):attr('scope', 'col')
local titleColspan = 2
if args[cfg.arg.imageleft] then titleColspan = titleColspan + 1 end
if args[cfg.arg.image] then titleColspan = titleColspan + 1 end
titleCell
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.titlestyle])
:addClass(cfg.class.navbox_title)
:attr('colspan', titleColspan)
renderNavBar(titleCell)
titleCell
:tag('div')
-- id for aria-labelledby attribute
:attr('id', mw.uri.anchorEncode(args[cfg.arg.title]))
:addClass(args[cfg.arg.titleclass])
:css('font-size', '114%')
:css('margin', '0 4em')
:wikitext(processItem(args[cfg.arg.title]))
end
local function getAboveBelowColspan()
local ret = 2
if args[cfg.arg.imageleft] then ret = ret + 1 end
if args[cfg.arg.image] then ret = ret + 1 end
return ret
end
local function renderAboveRow(tbl)
if not args[cfg.arg.above] then return end
tbl:tag('tr')
:tag('td')
:addClass(cfg.class.navbox_abovebelow)
:addClass(args[cfg.arg.aboveclass])
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.abovestyle])
:attr('colspan', getAboveBelowColspan())
:tag('div')
-- id for aria-labelledby attribute, if no title
:attr('id', (not args[cfg.arg.title]) and mw.uri.anchorEncode(args[cfg.arg.above]) or nil)
:wikitext(processItem(args[cfg.arg.above], args[cfg.arg.nowrapitems]))
end
local function renderBelowRow(tbl)
if not args[cfg.arg.below] then return end
tbl:tag('tr')
:tag('td')
:addClass(cfg.class.navbox_abovebelow)
:addClass(args[cfg.arg.belowclass])
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.belowstyle])
:attr('colspan', getAboveBelowColspan())
:tag('div')
:wikitext(processItem(args[cfg.arg.below], args[cfg.arg.nowrapitems]))
end
local function renderListRow(tbl, index, listnum, listnums_size)
local row = tbl:tag('tr')
if index == 1 and args[cfg.arg.imageleft] then
row
:tag('td')
:addClass(cfg.class.noviewer)
:addClass(cfg.class.navbox_image)
:addClass(args[cfg.arg.imageclass])
:css('width', '1px') -- Minimize width
:css('padding', '0 2px 0 0')
:cssText(args[cfg.arg.imageleftstyle])
:attr('rowspan', listnums_size)
:tag('div')
:wikitext(processItem(args[cfg.arg.imageleft]))
end
local group_and_num = format(cfg.arg.group_and_num, listnum)
local groupstyle_and_num = format(cfg.arg.groupstyle_and_num, listnum)
if args[group_and_num] then
local groupCell = row:tag('th')
-- id for aria-labelledby attribute, if lone group with no title or above
if listnum == 1 and not (args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group2]) then
groupCell
:attr('id', mw.uri.anchorEncode(args[cfg.arg.group1]))
end
groupCell
:attr('scope', 'row')
:addClass(cfg.class.navbox_group)
:addClass(args[cfg.arg.groupclass])
:cssText(args[cfg.arg.basestyle])
-- If groupwidth not specified, minimize width
:css('width', args[cfg.arg.groupwidth] or '1%')
groupCell
:cssText(args[cfg.arg.groupstyle])
:cssText(args[groupstyle_and_num])
:wikitext(args[group_and_num])
end
local listCell = row:tag('td')
if args[group_and_num] then
listCell
:addClass(cfg.class.navbox_list_with_group)
else
listCell:attr('colspan', 2)
end
if not args[cfg.arg.groupwidth] then
listCell:css('width', '100%')
end
local rowstyle -- usually nil so cssText(rowstyle) usually adds nothing
if index % 2 == 1 then
rowstyle = args[cfg.arg.oddstyle]
else
rowstyle = args[cfg.arg.evenstyle]
end
local list_and_num = format(cfg.arg.list_and_num, listnum)
local listText = args[list_and_num]
local oddEven = cfg.marker.oddeven
if listText:sub(1, 12) == '</div><table' then
-- Assume list text is for a subgroup navbox so no automatic striping for this row.
oddEven = listText:find(cfg.pattern.navbox_title) and cfg.marker.restart or cfg.class.navbox_odd_part
end
local liststyle_and_num = format(cfg.arg.liststyle_and_num, listnum)
local listclass_and_num = format(cfg.arg.listclass_and_num, listnum)
listCell
:css('padding', '0')
:cssText(args[cfg.arg.liststyle])
:cssText(rowstyle)
:cssText(args[liststyle_and_num])
:addClass(cfg.class.navbox_list)
:addClass(cfg.class.navbox_part .. oddEven)
:addClass(args[cfg.arg.listclass])
:addClass(args[listclass_and_num])
:tag('div')
:css('padding',
(index == 1 and args[cfg.arg.list1padding]) or args[cfg.arg.listpadding] or '0 0.25em'
)
:wikitext(processItem(listText, args[cfg.arg.nowrapitems]))
if index == 1 and args[cfg.arg.image] then
row
:tag('td')
:addClass(cfg.class.noviewer)
:addClass(cfg.class.navbox_image)
:addClass(args[cfg.arg.imageclass])
:css('width', '1px') -- Minimize width
:css('padding', '0 0 0 2px')
:cssText(args[cfg.arg.imagestyle])
:attr('rowspan', listnums_size)
:tag('div')
:wikitext(processItem(args[cfg.arg.image]))
end
end
local function has_list_class(htmlclass)
local patterns = {
'^' .. htmlclass .. '$',
'%s' .. htmlclass .. '$',
'^' .. htmlclass .. '%s',
'%s' .. htmlclass .. '%s'
}
for arg, _ in pairs(args) do
if type(arg) == 'string' and mw.ustring.find(arg, cfg.pattern.class) then
for _, pattern in ipairs(patterns) do
if mw.ustring.find(args[arg] or '', pattern) then
return true
end
end
end
end
return false
end
-- there are a lot of list classes in the wild, so we add their TemplateStyles
local function add_list_styles()
local frame = mw.getCurrentFrame()
local function add_list_templatestyles(htmlclass, templatestyles)
if has_list_class(htmlclass) then
return frame:extensionTag{
name = 'templatestyles', args = { src = templatestyles }
}
else
return ''
end
end
local hlist_styles = add_list_templatestyles('hlist', cfg.hlist_templatestyles)
local plainlist_styles = add_list_templatestyles('plainlist', cfg.plainlist_templatestyles)
-- a second workaround for [[phab:T303378]]
-- when that issue is fixed, we can actually use has_navbar not to emit the
-- tag here if we want
if has_navbar() and hlist_styles == '' then
hlist_styles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.hlist_templatestyles }
}
end
-- hlist -> plainlist is best-effort to preserve old Common.css ordering.
-- this ordering is not a guarantee because most navboxes will emit only
-- one of these classes [hlist_note]
return hlist_styles .. plainlist_styles
end
local function needsHorizontalLists(border)
if border == cfg.keyword.border_subgroup or args[cfg.arg.tracking] == cfg.keyword.tracking_no then
return false
end
return not has_list_class(cfg.pattern.hlist) and not has_list_class(cfg.pattern.plainlist)
end
local function hasBackgroundColors()
for _, key in ipairs({cfg.arg.titlestyle, cfg.arg.groupstyle,
cfg.arg.basestyle, cfg.arg.abovestyle, cfg.arg.belowstyle}) do
if tostring(args[key]):find('background', 1, true) then
return true
end
end
return false
end
local function hasBorders()
for _, key in ipairs({cfg.arg.groupstyle, cfg.arg.basestyle,
cfg.arg.abovestyle, cfg.arg.belowstyle}) do
if tostring(args[key]):find('border', 1, true) then
return true
end
end
return false
end
local function isIllegible()
local styleratio = require('Module:Color contrast')._styleratio
for key, style in pairs(args) do
if tostring(key):match(cfg.pattern.style) then
if styleratio{mw.text.unstripNoWiki(style)} < 4.5 then
return true
end
end
end
return false
end
local function getTrackingCategories(border)
local cats = {}
if needsHorizontalLists(border) then table.insert(cats, cfg.category.horizontal_lists) end
if hasBackgroundColors() then table.insert(cats, cfg.category.background_colors) end
if isIllegible() then table.insert(cats, cfg.category.illegible) end
if hasBorders() then table.insert(cats, cfg.category.borders) end
return cats
end
local function renderTrackingCategories(builder, border)
local title = mw.title.getCurrentTitle()
if title.namespace ~= 10 then return end -- not in template space
local subpage = title.subpageText
if subpage == cfg.keyword.subpage_doc or subpage == cfg.keyword.subpage_sandbox
or subpage == cfg.keyword.subpage_testcases then return end
for _, cat in ipairs(getTrackingCategories(border)) do
builder:wikitext('[[Category:' .. cat .. ']]')
end
end
local function renderMainTable(border, listnums)
local tbl = mw.html.create('table')
:addClass(cfg.class.nowraplinks)
:addClass(args[cfg.arg.bodyclass])
local state = args[cfg.arg.state]
if args[cfg.arg.title] and state ~= cfg.keyword.state_plain and state ~= cfg.keyword.state_off then
if state == cfg.keyword.state_collapsed then
state = cfg.class.collapsed
end
tbl
:addClass(cfg.class.collapsible)
:addClass(state or cfg.class.autocollapse)
end
tbl:css('border-spacing', 0)
if border == cfg.keyword.border_subgroup or border == cfg.keyword.border_none then
tbl
:addClass(cfg.class.navbox_subgroup)
:cssText(args[cfg.arg.bodystyle])
:cssText(args[cfg.arg.style])
else -- regular navbox - bodystyle and style will be applied to the wrapper table
tbl
:addClass(cfg.class.navbox_inner)
:css('background', 'transparent')
:css('color', 'inherit')
end
tbl:cssText(args[cfg.arg.innerstyle])
renderTitleRow(tbl)
renderAboveRow(tbl)
local listnums_size = #listnums
for i, listnum in ipairs(listnums) do
renderListRow(tbl, i, listnum, listnums_size)
end
renderBelowRow(tbl)
return tbl
end
local function add_navbox_styles(hiding_templatestyles)
local frame = mw.getCurrentFrame()
-- This is a lambda so that it doesn't need the frame as a parameter
local function add_user_styles(templatestyles)
if templatestyles and templatestyles ~= '' then
return frame:extensionTag{
name = 'templatestyles', args = { src = templatestyles }
}
end
return ''
end
-- get templatestyles. load base from config so that Lua only needs to do
-- the work once of parser tag expansion
local base_templatestyles = cfg.templatestyles
local templatestyles = add_user_styles(args[cfg.arg.templatestyles])
local child_templatestyles = add_user_styles(args[cfg.arg.child_templatestyles])
-- The 'navbox-styles' div exists to wrap the styles to work around T200206
-- more elegantly. Instead of combinatorial rules, this ends up being linear
-- number of CSS rules.
return mw.html.create('div')
:addClass(cfg.class.navbox_styles)
:wikitext(
add_list_styles() .. -- see [hlist_note] applied to 'before base_templatestyles'
base_templatestyles ..
templatestyles ..
child_templatestyles ..
table.concat(hiding_templatestyles)
)
:done()
end
-- work around [[phab:T303378]]
-- for each arg: find all the templatestyles strip markers, insert them into a
-- table. then remove all templatestyles markers from the arg
local function move_hiding_templatestyles(args)
local gfind = string.gfind
local gsub = string.gsub
local templatestyles_markers = {}
local strip_marker_pattern = '(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)'
for k, arg in pairs(args) do
for marker in gfind(arg, strip_marker_pattern) do
table.insert(templatestyles_markers, marker)
end
args[k] = gsub(arg, strip_marker_pattern, '')
end
return templatestyles_markers
end
function p._navbox(navboxArgs)
args = navboxArgs
local hiding_templatestyles = move_hiding_templatestyles(args)
local listnums = {}
for k, _ in pairs(args) do
if type(k) == 'string' then
local listnum = k:match(cfg.pattern.listnum)
if listnum then table.insert(listnums, tonumber(listnum)) end
end
end
table.sort(listnums)
local border = mw.text.trim(args[cfg.arg.border] or args[1] or '')
if border == cfg.keyword.border_child then
border = cfg.keyword.border_subgroup
end
-- render the main body of the navbox
local tbl = renderMainTable(border, listnums)
local res = mw.html.create()
-- render the appropriate wrapper for the navbox, based on the border param
if border == cfg.keyword.border_none then
res:node(add_navbox_styles(hiding_templatestyles))
local nav = res:tag('div')
:attr('role', 'navigation')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args[cfg.arg.title] or args[cfg.arg.above] or (args[cfg.arg.group1]
and not args[cfg.arg.group2]) then
nav:attr(
'aria-labelledby',
mw.uri.anchorEncode(
args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1]
)
)
else
nav:attr('aria-label', cfg.aria_label)
end
elseif border == cfg.keyword.border_subgroup then
-- We assume that this navbox is being rendered in a list cell of a
-- parent navbox, and is therefore inside a div with padding:0em 0.25em.
-- We start with a </div> to avoid the padding being applied, and at the
-- end add a <div> to balance out the parent's </div>
res
:wikitext('</div>')
:node(tbl)
:wikitext('<div>')
else
res:node(add_navbox_styles(hiding_templatestyles))
local nav = res:tag('div')
:attr('role', 'navigation')
:addClass(cfg.class.navbox)
:addClass(args[cfg.arg.navboxclass])
:cssText(args[cfg.arg.bodystyle])
:cssText(args[cfg.arg.style])
:css('padding', '3px')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args[cfg.arg.title] or args[cfg.arg.above]
or (args[cfg.arg.group1] and not args[cfg.arg.group2]) then
nav:attr(
'aria-labelledby',
mw.uri.anchorEncode(args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1])
)
else
nav:attr('aria-label', cfg.aria_label)
end
end
if (args[cfg.arg.nocat] or cfg.keyword.nocat_false):lower() == cfg.keyword.nocat_false then
renderTrackingCategories(res, border)
end
return striped(tostring(res), border)
end
function p.navbox(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {wrappers = {cfg.pattern.navbox}})
-- Read the arguments in the order they'll be output in, to make references
-- number in the right order.
local _
_ = args[cfg.arg.title]
_ = args[cfg.arg.above]
-- Limit this to 20 as covering 'most' cases (that's a SWAG) and because
-- iterator approach won't work here
for i = 1, 20 do
_ = args[format(cfg.arg.group_and_num, i)]
_ = args[format(cfg.arg.list_and_num, i)]
end
_ = args[cfg.arg.below]
return p._navbox(args)
end
return p
05be9a97c035ab3f0fac69423779e261949d473c
Module:Navbar
828
39
84
83
2023-11-27T15:13:09Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local function get_title_arg(is_collapsible, template)
local title_arg = 1
if is_collapsible then title_arg = 2 end
if template then title_arg = 'template' end
return title_arg
end
local function choose_links(template, args)
-- The show table indicates the default displayed items.
-- view, talk, edit, hist, move, watch
-- TODO: Move to configuration.
local show = {true, true, true, false, false, false}
if template then
show[2] = false
show[3] = false
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6,
talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
-- TODO: Consider removing TableTools dependency.
for _, v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
local remove_edit_link = args.noedit
if remove_edit_link then show[3] = false end
return show
end
local function add_link(link_description, ul, is_mini, font_style)
local l
if link_description.url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-' .. link_description.full)
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:attr('title', link_description.html_title)
:cssText(font_style)
:wikitext(is_mini and link_description.mini or link_description.full)
:done()
:wikitext(l[3])
:done()
end
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
if not title then
error(cfg.invalid_title .. title_text)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- TODO: Get link_descriptions and show into the configuration module.
-- link_descriptions should be easier...
local link_descriptions = {
{ ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template',
['link'] = title.fullText, ['url'] = false },
{ ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template',
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = 'Special:EditPage/' .. title.fullText, ['url'] = false },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = 'Special:PageHistory/' .. title.fullText, ['url'] = false },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template',
['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
local ul = mw.html.create('ul')
if has_brackets then
ul:addClass(cfg.classes.brackets)
:cssText(font_style)
end
for i, _ in ipairs(displayed_links) do
if displayed_links[i] then add_link(link_descriptions[i], ul, is_mini, font_style) end
end
return ul:done()
end
function p._navbar(args)
-- TODO: We probably don't need both fontstyle and fontcolor...
local font_style = args.fontstyle
local font_color = args.fontcolor
local is_collapsible = args.collapsible
local is_mini = args.mini
local is_plain = args.plain
local collapsible_class = nil
if is_collapsible then
collapsible_class = cfg.classes.collapsible
if not is_plain then is_mini = 1 end
if font_color then
font_style = (font_style or '') .. '; color: ' .. font_color .. ';'
end
end
local navbar_style = args.style
local div = mw.html.create():tag('div')
div
:addClass(cfg.classes.navbar)
:addClass(cfg.classes.plainlinks)
:addClass(cfg.classes.horizontal_list)
:addClass(collapsible_class) -- we made the determination earlier
:cssText(navbar_style)
if is_mini then div:addClass(cfg.classes.mini) end
local box_text = (args.text or cfg.box_text) .. ' '
-- the concatenated space guarantees the box text is separated
if not (is_mini or is_plain) then
div
:tag('span')
:addClass(cfg.classes.box_text)
:cssText(font_style)
:wikitext(box_text)
end
local template = args.template
local displayed_links = choose_links(template, args)
local has_brackets = args.brackets
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local list = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(list)
if is_collapsible then
local title_text_class
if is_mini then
title_text_class = cfg.classes.collapsible_title_mini
else
title_text_class = cfg.classes.collapsible_title_full
end
div:done()
:tag('div')
:addClass(title_text_class)
:cssText(font_style)
:wikitext(args[1])
end
local frame = mw.getCurrentFrame()
-- hlist -> navbar is best-effort to preserve old Common.css ordering.
return frame:extensionTag{
name = 'templatestyles', args = { src = cfg.hlist_templatestyles }
} .. frame:extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())
end
function p.navbar(frame)
return p._navbar(require('Module:Arguments').getArgs(frame))
end
return p
047f307758c878eb3e99ed1768cc40920a6ec5fa
Module:Navbar/configuration
828
40
86
85
2023-11-27T15:13:09Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
return {
['templatestyles'] = 'Module:Navbar/styles.css',
['hlist_templatestyles'] = 'Hlist/styles.css',
['box_text'] = 'This box: ', -- default text box when not plain or mini
['title_namespace'] = 'Template', -- namespace to default to for title
['invalid_title'] = 'Invalid title ',
['classes'] = { -- set a line to nil if you don't want it
['navbar'] = 'navbar',
['plainlinks'] = 'plainlinks', -- plainlinks
['horizontal_list'] = 'hlist', -- horizontal list class
['mini'] = 'navbar-mini', -- class indicating small links in the navbar
['this_box'] = 'navbar-boxtext',
['brackets'] = 'navbar-brackets',
-- 'collapsible' is the key for a class to indicate the navbar is
-- setting up the collapsible element in addition to the normal
-- navbar.
['collapsible'] = 'navbar-collapse',
['collapsible_title_mini'] = 'navbar-ct-mini',
['collapsible_title_full'] = 'navbar-ct-full'
}
}
b007c336b17ec4bcd4d5a9dca9f8cba301662b55
Module:Navbox/configuration
828
41
88
87
2023-11-27T15:13:10Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
return {
aria_label = 'Navbox',
nowrap_item = '%s<span class="nowrap">%s</span>',
templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Navbox/styles.css' }
},
hlist_templatestyles = 'Hlist/styles.css',
plainlist_templatestyles = 'Plainlist/styles.css',
-- do not localize marker table
marker = {
oddeven = '\127_ODDEVEN_\127',
restart = '\127_ODDEVEN0_\127',
regex = '\127_ODDEVEN(%d?)_\127'
},
category = {
orphan = '[[Category:Navbox orphans]]',
horizontal_lists = 'Navigational boxes without horizontal lists',
background_colors = 'Navboxes using background colours',
illegible = 'Potentially illegible navboxes',
borders = 'Navboxes using borders',
},
keyword = {
border_subgroup = 'subgroup',
border_child = 'child',
border_none = 'none',
evenodd_swap = 'swap',
navbar_off = 'off',
navbar_plain = 'plain',
nocat_false = 'false',
nowrapitems_yes = 'yes',
orphan_yes = 'yes',
state_collapsed = 'collapsed',
state_off = 'off',
state_plain = 'plain',
subpage_doc = 'doc',
subpage_sandbox = 'sandbox',
subpage_testcases = 'testcases',
tracking_no = 'no'
},
class = {
autocollapse = 'autocollapse',
collapsible = 'mw-collapsible',
collapsed = 'mw-collapsed',
-- Warning
navbox = 'navbox', -- WMF currently hides 'navbox' from mobile,
-- so you probably shouldn't change the navbox class.
navbox_abovebelow = 'navbox-abovebelow',
navbox_group = 'navbox-group',
navbox_image = 'navbox-image',
navbox_inner = 'navbox-inner',
navbox_list = 'navbox-list',
navbox_list_with_group = 'navbox-list-with-group',
navbox_part = 'navbox-', -- do not l10n
navbox_styles = 'navbox-styles',
navbox_subgroup = 'navbox-subgroup',
navbox_title = 'navbox-title', -- l10n only if you change pattern.navbox_title below
navbox_odd_part = 'odd', -- do not l10n
navbox_even_part = 'even', -- do not l10n
nomobile = 'nomobile',
nowraplinks = 'nowraplinks',
noviewer = 'noviewer' -- used to remove images from MediaViewer
},
pattern = {
listnum = '^list(%d+)$',
class = 'class',
sandbox = '/sandbox$',
navbox = 'Template:Navbox',
nowrap = '^<span class="nowrap">',
style = 'style$',
navbox_title = '<th[^>]*"navbox%-title"',
hlist = 'hlist',
plainlist = 'plainlist',
},
arg = {
above = 'above',
aboveclass = 'aboveclass',
abovestyle = 'abovestyle',
basestyle = 'basestyle',
bodyclass = 'bodyclass',
bodystyle = 'bodystyle',
border = 'border',
below = 'below',
belowclass = 'belowclass',
belowstyle = 'belowstyle',
evenodd = 'evenodd',
evenstyle = 'evenstyle',
group1 = 'group1',
group2 = 'group2',
group_and_num = 'group%d',
groupstyle_and_num = 'group%dstyle',
groupclass = 'groupclass',
groupstyle = 'groupstyle',
groupwidth = 'groupwidth',
innerstyle = 'innerstyle',
image = 'image',
imageclass = 'imageclass',
imageleft = 'imageleft',
imageleftstyle = 'imageleftstyle',
imagesetyle = 'imagestyle',
list_and_num = 'list%d',
listclass_and_num = 'list%dclass',
liststyle_and_num = 'list%dstyle',
list1padding = 'list1padding',
listclass = 'listclass',
listpadding = 'listpadding',
liststyle = 'liststyle',
name = 'name',
navbar = 'navbar',
navboxclass = 'navboxclass',
nocat = 'nocat',
nowrapitems = 'nowrapitems',
oddstyle = 'oddstyle',
orphan = 'orphan',
state = 'state',
style = 'style',
templatestyles = 'templatestyles',
child_templatestyles = 'child templatestyles',
title = 'title',
titleclass = 'titleclass',
titlestyle = 'titlestyle',
tracking = 'tracking'
},
-- names of navbar arguments
navbar = {
name = 1,
fontstyle = 'fontstyle',
mini = 'mini'
}
}
4148736fd32a93636c0413e73ed38afaef065ec9
Module:Color contrast
828
42
90
89
2023-11-27T15:13:10Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
--
-- This module implements
-- {{Color contrast ratio}}
-- {{Greater color contrast ratio}}
-- {{ColorToLum}}
-- {{RGBColorToLum}}
--
local p = {}
local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' )
local function sRGB (v)
if (v <= 0.03928) then
v = v / 12.92
else
v = math.pow((v+0.055)/1.055, 2.4)
end
return v
end
local function rgbdec2lum(R, G, B)
if ( 0 <= R and R < 256 and 0 <= G and G < 256 and 0 <= B and B < 256 ) then
return 0.2126 * sRGB(R/255) + 0.7152 * sRGB(G/255) + 0.0722 * sRGB(B/255)
else
return ''
end
end
local function hsl2lum(h, s, l)
if ( 0 <= h and h < 360 and 0 <= s and s <= 1 and 0 <= l and l <= 1 ) then
local c = (1 - math.abs(2*l - 1))*s
local x = c*(1 - math.abs( math.fmod(h/60, 2) - 1) )
local m = l - c/2
local r, g, b = m, m, m
if( 0 <= h and h < 60 ) then
r = r + c
g = g + x
elseif( 60 <= h and h < 120 ) then
r = r + x
g = g + c
elseif( 120 <= h and h < 180 ) then
g = g + c
b = b + x
elseif( 180 <= h and h < 240 ) then
g = g + x
b = b + c
elseif( 240 <= h and h < 300 ) then
r = r + x
b = b + c
elseif( 300 <= h and h < 360 ) then
r = r + c
b = b + x
end
return rgbdec2lum(255*r, 255*g, 255*b)
else
return ''
end
end
local function color2lum(c)
if (c == nil) then
return ''
end
-- html '#' entity
c = c:gsub("#", "#")
-- whitespace
c = c:match( '^%s*(.-)[%s;]*$' )
-- unstrip nowiki strip markers
c = mw.text.unstripNoWiki(c)
-- lowercase
c = c:lower()
-- first try to look it up
local L = HTMLcolor[c]
if (L ~= nil) then
return L
end
-- convert from hsl
if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9%.]*[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9%.]*)[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100)
end
-- convert from rgb
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*%)$')
return rgbdec2lum(tonumber(R), tonumber(G), tonumber(B))
end
-- convert from rgb percent
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100)
end
-- remove leading # (if there is one) and whitespace
c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$')
-- split into rgb
local cs = mw.text.split(c or '', '')
if( #cs == 6 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[2])
local G = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[4])
local B = 16*tonumber('0x' .. cs[5]) + tonumber('0x' .. cs[6])
return rgbdec2lum(R, G, B)
elseif ( #cs == 3 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[1])
local G = 16*tonumber('0x' .. cs[2]) + tonumber('0x' .. cs[2])
local B = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[3])
return rgbdec2lum(R, G, B)
end
-- failure, return blank
return ''
end
-- This exports the function for use in other modules.
-- The colour is passed as a string.
function p._lum(color)
return color2lum(color)
end
function p._greatercontrast(args)
local bias = tonumber(args['bias'] or '0') or 0
local css = (args['css'] and args['css'] ~= '') and true or false
local v1 = color2lum(args[1] or '')
local c2 = args[2] or '#FFFFFF'
local v2 = color2lum(c2)
local c3 = args[3] or '#000000'
local v3 = color2lum(c3)
local ratio1 = -1;
local ratio2 = -1;
if (type(v1) == 'number' and type(v2) == 'number') then
ratio1 = (v2 + 0.05)/(v1 + 0.05)
ratio1 = (ratio1 < 1) and 1/ratio1 or ratio1
end
if (type(v1) == 'number' and type(v3) == 'number') then
ratio2 = (v3 + 0.05)/(v1 + 0.05)
ratio2 = (ratio2 < 1) and 1/ratio2 or ratio2
end
if css then
local c1 = args[1] or ''
if mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c1 = '#' .. c1
end
if mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c2 = '#' .. c2
end
if mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c3 = '#' .. c3
end
return 'background-color:' .. c1 .. '; color:' .. ((ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or '') .. ';'
end
return (ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or ''
end
function p._ratio(args)
local v1 = color2lum(args[1])
local v2 = color2lum(args[2])
if (type(v1) == 'number' and type(v2) == 'number') then
-- v1 should be the brighter of the two.
if v2 > v1 then
v1, v2 = v2, v1
end
return (v1 + 0.05)/(v2 + 0.05)
else
return args['error'] or '?'
end
end
function p._styleratio(args)
local style = (args[1] or ''):lower()
local bg, fg = 'white', 'black'
local lum_bg, lum_fg = 1, 0
if args[2] then
local lum = color2lum(args[2])
if lum ~= '' then bg, lum_bg = args[2], lum end
end
if args[3] then
local lum = color2lum(args[3])
if lum ~= '' then fg, lum_fg = args[3], lum end
end
local slist = mw.text.split(mw.ustring.gsub(mw.ustring.gsub(style or '', '&#[Xx]23;', '#'), '#', '#'), ';')
for k = 1,#slist do
local s = slist[k]
local k,v = s:match( '^[%s]*([^:]-):([^:]-)[%s;]*$' )
k = k or ''
v = v or ''
if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background%-color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_bg = v, lum end
elseif (k:match('^[%s]*(color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_fg = v, lum end
end
end
if lum_bg > lum_fg then
return (lum_bg + 0.05)/(lum_fg + 0.05)
else
return (lum_fg + 0.05)/(lum_bg + 0.05)
end
end
--[[
Use {{#invoke:Color contrast|somecolor}} directly or
{{#invoke:Color contrast}} from a wrapper template.
Parameters:
-- |1= โ required; A color to check.
--]]
function p.lum(frame)
local color = frame.args[1] or frame:getParent().args[1]
return p._lum(color)
end
function p.ratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._ratio(args)
end
function p.styleratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._styleratio(args)
end
function p.greatercontrast(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._greatercontrast(args)
end
return p
1e399769117591366a63f62996c9a407077cc711
Module:Color contrast/colors
828
43
92
91
2023-11-27T15:13:11Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
return {
aliceblue = 0.92880068253475,
antiquewhite = 0.84646951707754,
aqua = 0.7874,
aquamarine = 0.8078549208338,
azure = 0.97265264954166,
beige = 0.8988459998705,
bisque = 0.80732327372979,
black = 0,
blanchedalmond = 0.85084439608156,
blue = 0.0722,
blueviolet = 0.12622014321946,
brown = 0.098224287876511,
burlywood = 0.51559844533893,
cadetblue = 0.29424681085422,
chartreuse = 0.76032025902623,
chocolate = 0.23898526114557,
coral = 0.37017930872924,
cornflowerblue = 0.30318641994179,
cornsilk = 0.93562110372965,
crimson = 0.16042199953026,
cyan = 0.7874,
darkblue = 0.018640801980939,
darkcyan = 0.20329317839046,
darkgoldenrod = 0.27264703559993,
darkgray = 0.39675523072563,
darkgreen = 0.091143429047575,
darkgrey = 0.39675523072563,
darkkhaki = 0.45747326349994,
darkmagenta = 0.07353047651207,
darkolivegreen = 0.12651920884889,
darkorange = 0.40016167026524,
darkorchid = 0.13413142174857,
darkred = 0.054889674531132,
darksalmon = 0.40541471563381,
darkseagreen = 0.43789249325969,
darkslateblue = 0.065792846227988,
darkslategray = 0.067608151928044,
darkslategrey = 0.067608151928044,
darkturquoise = 0.4874606277449,
darkviolet = 0.10999048339343,
deeppink = 0.23866895828276,
deepskyblue = 0.44481603395575,
dimgray = 0.14126329114027,
dimgrey = 0.14126329114027,
dodgerblue = 0.27442536991456,
firebrick = 0.10724525535015,
floralwhite = 0.95922484825004,
forestgreen = 0.18920812076002,
fuchsia = 0.2848,
gainsboro = 0.71569350050648,
ghostwhite = 0.94311261886323,
gold = 0.69860877428159,
goldenrod = 0.41919977809569,
gray = 0.2158605001139,
green = 0.15438342968146,
greenyellow = 0.80609472611453,
grey = 0.2158605001139,
honeydew = 0.96336535554782,
hotpink = 0.34658438169715,
indianred = 0.21406134963884,
indigo = 0.03107561486337,
ivory = 0.99071270600615,
khaki = 0.77012343394121,
lavender = 0.80318750514521,
lavenderblush = 0.90172748631046,
lawngreen = 0.73905893124963,
lemonchiffon = 0.94038992245622,
lightblue = 0.63709141280807,
lightcoral = 0.35522120733135,
lightcyan = 0.94587293494829,
lightgoldenrodyellow = 0.93348351018297,
lightgray = 0.65140563741982,
lightgreen = 0.69091979956865,
lightgrey = 0.65140563741982,
lightpink = 0.58566152734898,
lightsalmon = 0.4780675225206,
lightseagreen = 0.35050145117042,
lightskyblue = 0.56195637618331,
lightslategray = 0.23830165007287,
lightslategrey = 0.23830165007287,
lightsteelblue = 0.53983888284666,
lightyellow = 0.98161818392882,
lime = 0.7152,
limegreen = 0.44571042246098,
linen = 0.88357340984379,
magenta = 0.2848,
maroon = 0.045891942324215,
mediumaquamarine = 0.49389703310801,
mediumblue = 0.044077780212328,
mediumorchid = 0.21639251153773,
mediumpurple = 0.22905858091648,
mediumseagreen = 0.34393112338131,
mediumslateblue = 0.20284629471622,
mediumspringgreen = 0.70704308194184,
mediumturquoise = 0.5133827926448,
mediumvioletred = 0.14371899849357,
midnightblue = 0.02071786635086,
mintcream = 0.97834604947588,
mistyrose = 0.82183047859185,
moccasin = 0.80083000991567,
navajowhite = 0.76519682342785,
navy = 0.015585128108224,
oldlace = 0.91900633405549,
olive = 0.20027537200568,
olivedrab = 0.22593150951929,
orange = 0.4817026703631,
orangered = 0.25516243753416,
orchid = 0.31348806761439,
palegoldenrod = 0.78792647887614,
palegreen = 0.77936759006353,
paleturquoise = 0.76436077921714,
palevioletred = 0.28754994117889,
papayawhip = 0.87797100199835,
peachpuff = 0.74905589878251,
peru = 0.30113074877936,
pink = 0.63271070702466,
plum = 0.45734221587969,
powderblue = 0.68254586500605,
purple = 0.061477070432439,
rebeccapurple = 0.07492341159447,
red = 0.2126,
rosybrown = 0.32319457649407,
royalblue = 0.16663210743188,
saddlebrown = 0.097922285020521,
salmon = 0.36977241527596,
sandybrown = 0.46628543696283,
seagreen = 0.19734199706275,
seashell = 0.92737862206922,
sienna = 0.13697631337098,
silver = 0.52711512570581,
skyblue = 0.55291668518184,
slateblue = 0.14784278062136,
slategray = 0.20896704076536,
slategrey = 0.20896704076536,
snow = 0.96533341834849,
springgreen = 0.73052306068529,
steelblue = 0.20562642207625,
tan = 0.48237604163921,
teal = 0.16996855778968,
thistle = 0.56818401093733,
tomato = 0.30638612719415,
turquoise = 0.5895536427578,
violet = 0.40315452986676,
wheat = 0.74909702820482,
white = 1,
whitesmoke = 0.91309865179342,
yellow = 0.9278,
yellowgreen = 0.50762957208707,
}
6ae47fdb24de4eed5ec26d203faf5341a388987b
Template:Wrap
10
44
94
93
2023-11-27T15:13:11Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly><span class="wrap">{{{1| }}}</span></includeonly><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
aa85f77c2939e3f50fa04a160b08510cf331ee11
Module:High-use
828
45
96
95
2023-11-27T15:13:12Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
local p = {}
-- _fetch looks at the "demo" argument.
local _fetch = require('Module:Transclusion_count').fetch
local yesno = require('Module:Yesno')
function p.num(frame, count)
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
-- Build output string
local return_value = ""
if count == nil then
if frame.args[1] == "risk" then
return_value = "a very large number of"
else
return_value = "many"
end
else
-- Use 2 significant figures for smaller numbers and 3 for larger ones
local sigfig = 2
if count >= 100000 then
sigfig = 3
end
-- Prepare to round to appropriate number of sigfigs
local f = math.floor(math.log10(count)) - sigfig + 1
-- Round and insert "approximately" or "+" when appropriate
if (frame.args[2] == "yes") or (mw.ustring.sub(frame.args[1],-1) == "+") then
-- Round down
return_value = string.format("%s+", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )
else
-- Round to nearest
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
end
end
end
return return_value
end
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
local return_value = ""
if frame.args[1] == "risk" then
return_value = "risk"
else
local count = _fetch(frame)
if count and count >= 100000 then return_value = "risk" end
end
return return_value
end
function p.text(frame, count)
-- Only show the information about how this template gets updated if someone
-- is actually editing the page and maybe trying to update the count.
local bot_text = (frame:preprocess("{{REVISIONID}}") == "") and "\n\n----\n'''Preview message''': Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]])." or ''
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" or title.subpageText == "sandbox" then
title = title.basePageTitle
end
local systemMessages = frame.args['system']
if frame.args['system'] == '' then
systemMessages = nil
end
-- This retrieves the project URL automatically to simplify localiation.
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and ("''', and " .. templateCount) or ("'''"))
else
used_on_text = used_on_text .. templateCount .. "'''"
end
local sandbox_text = ("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. "):format(
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
mw.title.getCurrentTitle().namespace == 828 and "Module:Sandbox|module sandbox" or "Wikipedia:User pages#SUB|user subpage"
)
local infoArg = frame.args["info"] ~= "" and frame.args["info"]
if (systemMessages or frame.args[1] == "risk" or (count and count >= 100000) ) then
local info = systemMessages and '.<br/>Changes to it can cause immediate changes to the Wikipedia user interface.' or '.'
if infoArg then
info = info .. "<br />" .. infoArg
end
sandbox_text = info .. '<br /> To avoid major disruption' ..
(count and count >= 100000 and ' and server load' or '') ..
', any changes should be tested in the ' .. sandbox_text ..
'The tested changes can be added to this page in a single edit. '
else
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
'hanges may be widely noticed. Test changes in the ' .. sandbox_text
end
local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
else
discussion_text = string.format("%son the [[%s|talk page]]", discussion_text, title.talkPageTitle.fullText )
end
return used_on_text .. sandbox_text .. discussion_text .. " before implementing them." .. bot_text
end
function p.main(frame)
local count = nil
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
local type_param = "style"
local epilogue = ''
if frame.args['system'] and frame.args['system'] ~= '' then
image = "[[File:Ambox important.svg|40px|alt=Warning|link=]]"
type_param = "content"
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local categorise = (nocat == '' or not yesno(nocat))
if categorise then
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
end
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"
type_param = "content"
end
if frame.args["form"] == "editnotice" then
return frame:expandTemplate{
title = 'editnotice',
args = {
["image"] = image,
["text"] = p.text(frame, count),
["expiry"] = (frame.args["expiry"] or "")
}
} .. epilogue
else
return require('Module:Message box').main('ombox', {
type = type_param,
image = image,
text = p.text(frame, count),
expiry = (frame.args["expiry"] or "")
}) .. epilogue
end
end
return p
134551888e066954a89c109d2faa8af71a4454a4
Template:Template parameter usage
10
46
98
97
2023-11-27T15:13:12Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{#switch:{{{label|}}}
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|this template}} in articles{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|[[Template:{{ROOTPAGENAME}}]]}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|#default=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{{label|}}}]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
}}<noinclude>
{{documentation}}
</noinclude>
10a89e6a4bc63a1427518ea21bf94b8f623a7391
Template:Yesno-no
10
47
100
99
2023-11-27T15:13:12Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|ยฌ={{{ยฌ|no}}}|def={{{def|no}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1ad7b7800da1b867ead8f6ff8cef76e6201b3b56
Template:Lua
10
48
102
101
2023-11-27T15:13:13Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{Lua|Module:Lua banner}}
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
dba3962144dacd289dbc34f50fbe0a7bf6d7f2f7
Module:Lua banner
828
49
104
103
2023-11-27T15:13:13Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
return box .. trackingCategories
end
function p.renderBox(modules)
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox.exists then
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText)
end
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" then
title = title.basePageTitle
end
if title.contentModel == "Scribunto" then
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
boxArgs.text = 'This template uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-Logo.svg|30px|alt=|link=]]'
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj)
if yesno(args.nocat) then
return ''
end
local cats = {}
-- Error category
if #modules < 1 then
cats[#cats + 1] = 'Lua templates with errors'
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
local subpageBlacklist = {
doc = true,
sandbox = true,
sandbox2 = true,
testcases = true
}
if not subpageBlacklist[titleObj.subpageText] then
local protCatName
if titleObj.namespace == 10 then
local category = args.category
if not category then
local categories = {
['Module:String'] = 'Templates based on the String Lua module',
['Module:Math'] = 'Templates based on the Math Lua module',
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
['Module:Citation/CS1'] = 'Templates based on the Citation/CS1 Lua module'
}
category = modules[1] and categories[modules[1]]
category = category or 'Lua-based templates'
end
cats[#cats + 1] = category
protCatName = "Templates using under-protected Lua modules"
elseif titleObj.namespace == 828 then
protCatName = "Modules depending on under-protected modules"
end
if not args.noprotcat and protCatName then
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
break
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
03ec1b34a40121efc562c0c64a67ebbf57d56dff
Module:Yesno
828
50
106
105
2023-11-27T15:13:14Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Module:Message box
828
51
108
107
2023-11-27T15:13:14Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
require('strict')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
self.typeImageNeedsLink = typeData.imageNeedsLink
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s%s|alt=]]', self.typeImage
or 'Information icon4.svg', imageSize, self.typeImageNeedsLink and "" or "|link=" )
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
f2fb84f7b817d2d88747f57c40902a0d8be8158a
Module:Message box/configuration
828
52
110
109
2023-11-27T15:13:14Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '<small>[[Help:Maintenance template removal|Learn how and when to remove this template message]]</small>',
templatestyles = 'Module:Message box/ambox.css'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true,
templatestyles = 'Module:Message box/cmbox.css'
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false,
templatestyles = 'Module:Message box/fmbox.css'
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox-license.svg'
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg',
imageNeedsLink = true
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes',
templatestyles = 'Module:Message box/imbox.css'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true,
templatestyles = 'Module:Message box/ombox.css'
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
templateCategory = 'Talk message boxes',
templatestyles = 'Module:Message box/tmbox.css'
}
}
27f00af5cf3939613e9156acd5e62a3469d03d81
Template:Large
10
53
112
111
2023-11-27T15:13:15Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<span style="font-size:120%">{{{1}}}</span><noinclude>
{{Documentation}}
</noinclude>
8ba6ec8c3178e22dc1f05aa239df8a2b052be668
Template:Hlist
10
54
114
113
2023-11-27T15:13:15Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|horizontal}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
9e3824c2e3c0e0dbef2f37556ac0b994987fecf9
Template:Longitem
10
55
116
115
2023-11-27T15:13:16Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<noinclude>{{#tag: code|
</noinclude>{{#ifeq: {{{1|+}}} | {{{1|-}}} | <div style="}}display: inline-block; line-height: 1.2em; padding: .1em 0; {{#ifeq: {{{1|+}}} | {{{1|-}}} | {{{style|}}}">{{{1|}}}</div> | <includeonly>width: 100%;</includeonly> }}<includeonly>{{#if:{{{2|}}}|[[Category:Pages using Template:Longitem with unnamed style parameter]]}}</includeonly><noinclude>
|lang=wikitext}}
{{documentation}}
</noinclude>
2919b818deb36b243e9f9517917cbcfaa2c8d4ec
Template:Microformat message
10
56
118
117
2023-11-27T15:13:16Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
The [[Help:HTML in wikitext|HTML mark-up]] produced by this template includes {{#if:{{{type|}}} |{{{type}}} |an [[{{{format}}} microformat]]}} that makes {{{data}}} readily [[Parsing|parsable]] by computer programs. This aids tasks such as the cataloguing of articles and maintenance of databases. For more information about the use of microformats on Wikipedia, please visit [[Wikipedia:WikiProject Microformats|the Microformat WikiProject]].<!--
-->{{#if:{{{subtemplates<includeonly>|</includeonly>}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{large|Subtemplates}}
{{{subtemplates}}}
'''''Please do not remove instances of these subtemplates.'''''
</div>}}<!--
-->{{#if:{{{subsection1|}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;"><!--(newline in case subsection begins with heading:)-->
{{{subsection1}}}
</div>}}<!--
-->{{#if:{{{1<includeonly>|</includeonly>}}} <!--(i.e. if at least one unnamed parameter supplied:)-->
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{large|Classes used}}
The [[HTML attribute|HTML class]]es of this microformat include:
: {{hlist
|item_style=font-size:110%;{{{itemstyle|}}}
|{{{1}}} |{{{2<includeonly>|</includeonly>}}} |{{{3|<noinclude>{{nobold|โฆโฆ}}</noinclude>}}}
|{{{4|}}} |{{{5|}}} |{{{6|}}} |{{{7|}}} |{{{8|}}} |{{{9|}}} |{{{10|}}} |{{{11|}}} |{{{12|}}} |{{{13|}}} |{{{14|}}} |{{{15|}}} |{{{16|}}} |{{{17|}}} |{{{18|}}} |{{{19|}}} |{{{20|}}}
}} </div>
{{longitem|style=line-height:1.3em|'''''Please do not rename or remove these classes{{#if:{{{nocollapse<includeonly>|</includeonly>}}} |<br/>nor collapse nested elements which use them}}.'''''}}<!--
-->}}<!--(end #if:[1])--><noinclude>
{{Documentation}}
</noinclude>
25d8c54d56c1c64f1b98e6c8b2a50054e6a9deb5
Template:Tl
10
57
120
119
2023-11-27T15:13:17Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
{{Redirect category shell|
{{R from move}}
}}
d6593bb3b4a866249f55d0f34b047a71fe1f1529
Template:Template link
10
58
122
121
2023-11-27T15:13:17Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
eabbec62efe3044a98ebb3ce9e7d4d43c222351d
Template:Documentation subpage
10
59
124
123
2023-11-27T15:13:17Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
| <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
</includeonly><!--
-->{{#ifeq:{{{doc-notice|show}}} |show
| {{Mbox
| type = notice
| style = margin-bottom:1.0em;
| image = [[File:Edit-copy green.svg|40px|alt=|link=]]
| text =
{{strong|This is a [[Wikipedia:Template documentation|documentation]] [[Wikipedia:Subpages|subpage]]}} for {{terminate sentence|{{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}}}<br />It may contain usage information, [[Wikipedia:Categorization|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} |{{#ifeq:{{SUBJECTSPACE}} |{{ns:User}} |{{lc:{{SUBJECTSPACE}}}} template page |{{#if:{{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}.
}}
}}<!--
-->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
-->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
| <includeonly><!--
-->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
| [[Category:Documentation subpages without corresponding pages]]
}}<!--
--></includeonly>
}}<!--
(completing initial #ifeq: at start of template:)
--><includeonly>
| <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
}}<!--
--></includeonly><noinclude>{{Documentation}}</noinclude>
41ca90af0945442788a2dbd08c8c54a61a23c057
Template:Campaignbox Second Punic War
10
60
126
125
2023-11-27T15:13:18Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{Campaignbox
| name = Campaignbox Second Punic War
| title = [[Second Punic War|{{Wrap|Second Punic War}}]]
| listclass = hlist
| battles =
; Prelude
* [[Siege of Saguntum|Saguntum]]
* [[Battle of Rhone Crossing|Rhone]]
* [[Hannibal's crossing of the Alps|Crossing of the Alps]]
; Italy
* [[Battle of Ticinus|Ticinus]]
* [[Battle of the Trebia|Trebia]]
* [[Siege of Mutina (218 BC)|Mutina]]
* [[Battle of Placentia (217 BC)|Placentia]]
* [[Battle of Victumulae|Victumulae]]
* [[Battle of Lake Trasimene|Lake Trasimene]]
* [[Battle of Umbrian Lake|Umbrian Lake]]
* [[Hannibal's crossing of the Apennines|Crossing of the Apennines]]
* [[Battle of Ager Falernus|Ager Falernus]]
* [[Battle of Geronium|Geronium]]
* [[Battle of Cannae|Cannae]]
* [[Battle of Silva Litana|Silva Litana]]
* [[Battle of Nola (216 BC)|1st Nola]]
* [[Siege of Nuceria Alfaterna|Nuceria Alfaterna]]
* [[Siege of Casilinum (216โ215 BC)|1st Casilinum]]
* [[Battle of Hamae|Hamae]]
* [[Siege of Petelia|1st Petelia]]
* [[Battle of Cumae (215 BC)|Cumae]]
* [[Battle of Nola (215 BC)|2nd Nola]]
* [[Battle of Beneventum (214 BC)|1st Beneventum]]
* [[Battle of Nola (214 BC)|3rd Nola]]
* [[Siege of Casilinum (214 BC)|2nd Casilinum]]
* [[Battle of Lucania|Lucania]]
* [[Siege of Arpi|Arpi]]
* [[Battle of Tarentum (212 BC)|1st Tarentum]]
* [[Battle of Beneventum (212 BC)|2nd Beneventum]]
* [[Battle of Campi Veteres|Campi Veteres]]
* [[Battle of Capua|1st Capua]]
* [[Battle of the Silarus|Silarus]]
* [[Battle of Herdonia (212 BC)|1st Herdonia]]
* [[Siege of Capua (211 BC)|2nd Capua]]
* [[Hannibal's raid to Rome|Rome]]
* [[Battle of Sapriportis|Sapriportis]]
* [[Battle of Herdonia (210 BC)|2nd Herdonia]]
* [[Battle of Numistro|Numistro]]
* [[Battle of Canusium|Canusium]]
* [[Siege of Manduria|Manduria]]
* [[Siege of Caulonia|Caulonia]]
* [[Battle of Tarentum (209 BC)|2nd Tarentum]]
* [[Battle of Locri (208 BC)|Locri]]
* [[Battle of Petelia|2nd Petelia]]
* [[Battle of Venusia|Venusia]]
* [[Battle of Grumentum|Grumentum]]
* [[Battle of the Metaurus|Metaurus]]
* [[Battle of Crotona|Crotona]]
* [[Battle of Insubria|Insubria]]
; Iberia
* [[Battle of Cissa|Cissa]]
* [[Battle of Ebro River|Ebro River]]
* [[Battle of Ibera|Ibera]]
* [[Siege of Illiturgis|Illiturgis]]
* [[Battle of Munda (214 BC)|Munda]]
* [[Battle of Orongi|Orongi]]
* [[Battle of the Upper Baetis|Upper Baetis]]
* [[Battle of New Carthage|1st New Carthage]]
* [[Battle of Baria|Baria]]
* [[Battle of Baecula|Baecula]]
* [[Battle of Ilipa|Ilipa]]
* [[Mutiny at Sucro|Sucro]]
* [[Battle of Carteia|1st Carteia]]
* [[Battle of Carteia (naval)|2nd Carteia]]
* [[Battle of Cartagena (206 BC)|2nd New Carthage]]
; Sicily and Sardinia
* [[Battle of Lilybaeum|Lilybaeum]]
* [[Capture of Malta (218 BC)|Malta]]
* [[Battle of Decimomannu|Decimomannu]]
* [[Battle of Leontini|Leontini]]
* [[Siege of Syracuse (213โ212 BC)|Syracuse]]
* [[Battle of Himera (211 BC)|Himera]]
* [[Siege of Agrigentum (210 BC)|Agrigentum]]
; North Africa
* [[Siege of Utica (204 BC)|1st Utica]]
* [[Battle of Utica (203 BC)|2nd Utica]]
* [[Battle of the Great Plains|Great Plains]]
* [[Battle of Cirta|Cirta]]
* [[Battle of Zama|Zama]]
}}<noinclude>
[[Category:Punic Wars navigational boxes|Second Punic War]]
[[Category:Ancient Rome campaignbox templates|Campaign]]
</noinclude>
f3015ca66e7919fa2b20c4ea9e8e7f8fb1283732
Template:Campaignbox Punic Wars
10
61
128
127
2023-11-27T15:13:18Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{Campaignbox
| name = Campaignbox Punic Wars
| title = [[Punic Wars]]
| listclass = hlist
| battles =
* [[First Punic War|First]]
* [[Mercenary War|Mercenary]]
* [[Second Punic War|Second]]
* [[Third Punic War|Third]]
}}<noinclude>
[[Category:Punic Wars navigational boxes|Punic wars]]
</noinclude>
68f988c5de0f66decd657e0721bfd60f1b4c7798
Template:Para
10
62
130
129
2023-11-27T15:13:18Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<code class="tpl-para" style="word-break:break-word;{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
06006deea2ed5d552aab61b4332321ab749ae7e8
Template:Tlf
10
63
132
131
2023-11-27T15:13:19Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Template link with link off]]
{{Redirect category shell|
{{R from move}}
}}
52759e1d3f7c9aa4a03d0b7d4f84f4c6adf53edf
Template:Template link with link off
10
64
134
133
2023-11-27T15:13:19Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nowrap=yes|nolink=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlf}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
b099fea5d1f36b0b4b9cb253ad3a9f4e095f6851
Template:Spaced ndash
10
65
136
135
2023-11-27T15:13:19Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Spaced en dash]]
{{R from move}}
943ce837a48a4907650d7398e8d10271b21dde62
Template:Spaced en dash
10
66
138
137
2023-11-27T15:13:20Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
– <noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
235afe8e7aca71d984c1bba5d8c96db414594b53
Module:Template link general
828
67
140
139
2023-11-27T15:13:20Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
-- This implements Template:Tlg
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Is a string non-empty?
local function _ne(s)
return s ~= nil and s ~= ""
end
local nw = mw.text.nowiki
local function addTemplate(s)
local i, _ = s:find(':', 1, true)
if i == nil then
return 'Template:' .. s
end
local ns = s:sub(1, i - 1)
if ns == '' or mw.site.namespaces[ns] then
return s
else
return 'Template:' .. s
end
end
local function trimTemplate(s)
local needle = 'template:'
if s:sub(1, needle:len()):lower() == needle then
return s:sub(needle:len() + 1)
else
return s
end
end
local function linkTitle(args)
if _ne(args.nolink) then
return args['1']
end
local titleObj
local titlePart = '[['
if args['1'] then
-- This handles :Page and other NS
titleObj = mw.title.new(args['1'], 'Template')
else
titleObj = mw.title.getCurrentTitle()
end
titlePart = titlePart .. (titleObj ~= nil and titleObj.fullText or
addTemplate(args['1']))
local textPart = args.alttext
if not _ne(textPart) then
if titleObj ~= nil then
textPart = titleObj:inNamespace("Template") and args['1'] or titleObj.fullText
else
-- redlink
textPart = args['1']
end
end
if _ne(args.subst) then
-- HACK: the ns thing above is probably broken
textPart = 'subst:' .. textPart
end
if _ne(args.brace) then
textPart = nw('{{') .. textPart .. nw('}}')
elseif _ne(args.braceinside) then
textPart = nw('{') .. textPart .. nw('}')
end
titlePart = titlePart .. '|' .. textPart .. ']]'
if _ne(args.braceinside) then
titlePart = nw('{') .. titlePart .. nw('}')
end
return titlePart
end
function p.main(frame)
local args = getArgs(frame, {
trim = true,
removeBlanks = false
})
return p._main(args)
end
function p._main(args)
local bold = _ne(args.bold) or _ne(args.boldlink) or _ne(args.boldname)
local italic = _ne(args.italic) or _ne(args.italics)
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
local code = _ne(args.code) or _ne(args.tt)
local show_result = _ne(args._show_result)
local expand = _ne(args._expand)
-- Build the link part
local titlePart = linkTitle(args)
if bold then titlePart = "'''" .. titlePart .. "'''" end
if _ne(args.nowrapname) then titlePart = '<span class="nowrap">' .. titlePart .. '</span>' end
-- Build the arguments
local textPart = ""
local textPartBuffer = "|"
local codeArguments = {}
local codeArgumentsString = ""
local i = 2
local j = 1
while args[i] do
local val = args[i]
if val ~= "" then
if _ne(args.nowiki) then
-- Unstrip nowiki tags first because calling nw on something that already contains nowiki tags will
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
val = nw(mw.text.unstripNoWiki(val))
end
local k, v = string.match(val, "(.*)=(.*)")
if not k then
codeArguments[j] = val
j = j + 1
else
codeArguments[k] = v
end
codeArgumentsString = codeArgumentsString .. textPartBuffer .. val
if italic then
val = '<span style="font-style:italic;">' .. val .. '</span>'
end
textPart = textPart .. textPartBuffer .. val
end
i = i + 1
end
-- final wrap
local ret = titlePart .. textPart
if not dontBrace then ret = nw('{{') .. ret .. nw('}}') end
if _ne(args.a) then ret = nw('*') .. ' ' .. ret end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
if code then
ret = '<code>' .. ret .. '</code>'
elseif _ne(args.plaincode) then
ret = '<code style="border:none;background:transparent;">' .. ret .. '</code>'
end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
--[[ Wrap as html??
local span = mw.html.create('span')
span:wikitext(ret)
--]]
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
if show_result then
local result = mw.getCurrentFrame():expandTemplate{title = addTemplate(args[1]), args = codeArguments}
ret = ret .. " โ " .. result
end
if expand then
local query = mw.text.encode('{{' .. addTemplate(args[1]) .. string.gsub(codeArgumentsString, textPartBuffer, "|") .. '}}')
local url = mw.uri.fullUrl('special:ExpandTemplates', 'wpInput=' .. query)
mw.log()
ret = ret .. " [" .. tostring(url) .. "]"
end
return ret
end
return p
c7307fa3959d308a2dd7fd2f5009c1ce6db3d122
Template:High-use
10
68
142
141
2023-11-27T15:13:21Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:High-use|main|1={{{1|}}}|2={{{2|}}}|info={{{info|}}}|demo={{{demo|}}}|form={{{form|}}}|expiry={{{expiry|}}}|system={{{system|}}}}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! -->
</noinclude>
a3322d1bd47ac03df14fa2090855cff4fede9bc7
Template:Flagicon
10
69
144
143
2023-11-27T15:13:21Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{safesubst<noinclude />:#ifeq: {{Yesno-no|{{{noredlink|}}}}}|yes<noinclude><!--
--></noinclude>|<noinclude><!--
#Check for existence of Template: Country data foo before invoking it
--></noinclude>{{safesubst<noinclude />:#ifexist: Template: Country data {{{1|}}}<noinclude><!--
--></noinclude>|<noinclude><!--
# It exists, so proceed
--></noinclude>{{country data {{{1|}}}|flagicon/core|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude><!--
--></noinclude>|<noinclude><!--
# It doesn't exist, so do nothing
--></noinclude>}}<noinclude><!--
--></noinclude>|<noinclude><!--
# DEFAULT call Template: Country data {{{1|}}}
# with no prior checks
--></noinclude>{{country data {{{1|}}}|flagicon/core|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude><!--
# Track use where "Template:Country data Foo" does not exist
--></noinclude>{{safesubst<noinclude />:#ifexist: Template:Country data {{{1|}}}||{{safesubst<noinclude />:namespace detect showall
| 1 =
| 2 = [[Category:Flagicons with missing country data templates]]
| user = 1
| talk = 1
| other = 2
}}}}<noinclude><!--
--></noinclude>}}</includeonly>{{safesubst<noinclude />:#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using flagicon template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Flagicon]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | noredlink | size | variant }}<noinclude>
{{Documentation}}
</noinclude>
4ba00e607bb28194908c631e424736dd64374684
Template:Country data Sweden
10
70
146
145
2023-11-27T15:13:22Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Sweden
| flag alias = Flag of Sweden.svg
| flag alias-army = Naval Ensign of Sweden.svg
| flag alias-air force =Naval Ensign of Sweden.svg
| flag alias-1818 = Swedish and Norwegian merchant flag 1818-1844.svg
| flag alias-1844 = Swedish civil ensign (1844โ1905).svg
| flag alias-1905 = Flag of Sweden (pre-1906).svg
| flag alias-naval = Naval Ensign of Sweden.svg
| flag alias-naval-1844 = Naval Ensign of Sweden (1844-1905).svg
| flag alias-naval-1815 = Swedish and Norwegian naval ensign (1815-1844).svg
| link alias-army = Swedish Army
| link alias-air force = Swedish Air Force
| link alias-naval = Swedish Navy
| flag alias-navy = Naval Ensign of Sweden.svg
| link alias-navy = Swedish Navy
| link alias-football = Sweden {{{mw|men's}}} national {{{age|}}} football team
| border-army =
| border-air force =
| border-naval =
| border-navy =
| border-naval-1815 =
| border-naval-1844 =
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1818
| var2 = 1844
| var3 = 1905
| var4 = naval-1844
| var5 = naval-1815
| redir1 = SWE
</noinclude>
}}
c92ed3fc692a32952044c5efaac25842974ca1c4
Template:Flagicon/core
10
71
148
147
2023-11-27T15:13:22Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<span class="flagicon">[[File:{{{flag alias-{{{variant}}}|{{safesubst<noinclude />:#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{safesubst<noinclude />:#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{safesubst<noinclude />:#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt={{{alias}}}|link={{{alias}}}]]</span><noinclude>{{documentation}}</noinclude>
14677aa18a0f6a866112637a51ba28adf4dd4bbe
Template:Flag
10
72
150
149
2023-11-27T15:13:23Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{country data {{{1|}}}|flag/core|name={{{name|{{{1|}}}}}}|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude>{{documentation}}</noinclude>
d13aac8e23bee030a6fc9b49a8aa1135104ace22
Template:Country data Holy Roman Empire
10
73
152
151
2023-11-27T15:13:23Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Holy Roman Empire
| flag alias = Banner of the Holy Roman Emperor (after 1400).svg
| flag alias-1200 = Flag of the Holy Roman Empire (1200-1350).svg
| flag alias-old = Heiliges Rรถmisches Reich - Reichssturmfahne vor 1433.svg
| size = {{{size|}}}
| name = {{{name|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1200
| var2 = old
</noinclude>
}}
c24cc53598b544658ee4420e6aa0370eca6c4d78
Template:Flag/core
10
74
154
153
2023-11-27T15:13:23Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<span class="flagicon">[[File:{{{flag alias-{{{variant}}}|{{#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt=|link=]] {{#switch:{{{flag alias}}}|Flag of Switzerland.svg|Flag of the Vatican City.svg|Flag of Switzerland (Pantone).svg|Flag of Vatican City State - 2023 version.svg= }}{{#ifeq:{{{alias}}}|Nepal| }}</span>[[{{{alias}}}|{{{name}}}]]<noinclude>{{documentation}}</noinclude>
0714064913bcc5abd9dae55d4fb50f52965eef35
Template:Flagicon image
10
75
156
155
2023-11-27T15:13:25Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<span class="flagicon">[[File:{{#if:{{{1|}}}|{{{1}}}|Flag placeholder.svg}}|{{{size|23x15px}}}|{{{border|{{#if:{{{1|}}}|border}}}}} |alt=|link={{{link|}}}]]</span><noinclude>{{documentation}}</noinclude>
057d0b94a9367359ad010c3da1fcdcb1e880dcb5
Template:Coord
10
76
158
157
2023-11-27T15:13:25Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Coordinates|coord}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
05c1e2a95ff86fa91442c704f36a9f125b603492
Template:Blue
10
77
160
159
2023-11-27T15:13:26Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<span style="color:blue">{{{1}}}</span><noinclude>
<!-- Add categories and interwikis to the /doc subpage, not here! -->
{{Documentation}}</noinclude>
89f3353953a76d63c4ba5cd23af400b64ef178f4
Template:KIA
10
78
162
161
2023-11-27T15:13:26Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
[[<!---(link:)-->{{{1|Killed in action}}}<!--
-->|<!--(label:)-->{{#ifeq:{{{alt|}}}|yes |(KIA) |<span style="font-family:'Times New Roman','Old English Text MT',serif">{{#ifeq:{{{bold|}}}|no |† |'''†'''}}</span>}}<!--
-->]]<noinclude>
{{Documentation}}
</noinclude>
40db638380717ea2f21d23962d35f009deec5b20
Template:Country data Electorate of Saxony
10
79
164
163
2023-11-27T15:13:26Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Electorate of Saxony
| shortname alias = Saxony
| flag alias = Flag of Electoral Saxony.svg
| size = {{{size|}}}
| name = {{{name|}}}
<noinclude>
| related1 = Kingdom of Saxony
| related2 = Saxony
| cat = Saxony electorate
</noinclude>
}}
92d992249b05224909f6fc125f5b07f9889af451
Template:DOW
10
80
166
165
2023-11-27T15:13:27Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
([[Killed in action|{{abbr|DOW|Died of wounds}}]])<noinclude>
<!-- Add categories and interwikis to the /doc subpage, not here! -->
{{Documentation}}
</noinclude>
a14551ef11993cd99ef9b8d4f781f0feaf2e7640
Template:Fakeref
10
81
168
167
2023-11-27T15:13:27Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Dummy reference]]
c85c391fe2de3ebfd2154c56303a2085c57e9dd2
Template:Dummy reference
10
82
170
169
2023-11-27T15:13:27Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<sup class="reference nowrap ltr" style="color:#002bb8;">[{{#ifeq:{{yes/no|{{{txtital|}}}}}|yes|<span style="font-style:italic">}}{{#if:{{{txtcol|}}}|<span style="color:{{{txtcol|}}}">}}{{{1|1}}}{{#if:{{{txtcol|}}}|</span>}}{{#ifeq:{{yes/no|{{{txtital|}}}}}|yes|</span>}}]</sup><noinclude>
{{documentation}}
</noinclude>
7be6798eb28af3f887fa775b50dc87e0c575cde9
Template:Campaign/doc
10
83
172
171
2023-11-27T15:13:28Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Campaignbox/doc]]
96204735bd25c964b25be72f9fe56c67b3302279
Template:Campaignbox/doc
10
84
174
173
2023-11-27T15:13:28Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{#ifeq:{{{noheader|}}}|yes |
| {{Documentation subpage}}
{{Template display|nomobile}}
{{Template redirect|Campaign}}
{{Navbox visibility}}
== Usage ==
}}
{{#switch:{{ARTICLESPACE}}
| Wikipedia =
====Campaignboxes====
| #default =
===Campaignboxes===
}}
One common type of navigational template in articles concerning conflicts, wars and related topics is the '''campaignbox''' template, intended to provide context and convenient navigation among articles on the [[battles]] in a [[Military campaign|campaign]], [[Front (military)|front]], [[Theater (warfare)|theater]] or [[war]] (or, more rarely, among several campaigns or wars).
<div style="float:right;width:26.7em;margin-bottom:1.0em;">
{{Campaignbox Second Punic War}}
{{Campaignbox Punic Wars}}
</div>
If the article includes an [[Help:Infobox|infobox]], the campaignbox/es are usually placed immediately after it (i.e. just below it). If available, as with infoboxes such as {{tl|Infobox military conflict}}, use the infobox's {{para|campaignbox}} parameter:
<div style="width:25.0em;border:1px solid black;background:#ddd;padding:0.5em 1.0em;">
<syntaxhighlight lang="wikitext">
{{Infobox military conflict
...
}}
{{Campaignbox XXXX}}
</syntaxhighlight>or<syntaxhighlight lang="wikitext">
{{Infobox military conflict
...
| campaignbox = {{campaignbox XXXX}}
}}
</syntaxhighlight></div>
Articles may include multiple campaignboxes; typically, these are stacked under the infobox. The most common scenario occurs when two levels of campaignboxes are present โ for example, an article about a battle can include both a campaignbox listing the battle itself and an "enclosing" campaignbox listing the campaign, theater or war during which the battle took place. Similarly, an article about a war can include both a campaignbox listing the war (among a series of wars) and a campaignbox for the war itself, listing the battles that took place during it.
=== Creating campaignboxes ===
Existing campaignboxes may be viewed through the [[:Category:Campaignbox templates|Campaignbox template category]] to which campaignboxes are added automatically. If a new campaignbox becomes necessary, it should be named ''Template:Campaignbox XXXX'' (where XXXX is the (shortened) name of the campaign) and should use {{tlf|Campaignbox}} thus:
<div style="width:16.7em;border:1px solid black;background:#ddd;padding:0.5em 1.0em;">
<syntaxhighlight lang="wikitext">
{{Campaignbox
| name =
| title =
| battles =
| notes =
}}
</syntaxhighlight>
</div>
==== Parameters ====
; ''name'' : The name by which Wikipedia refers to the template, i.e. "Template:Campaignbox XXXX". This can be produced by using <code><nowiki>{{subst:PAGENAME}}</nowiki></code>.
; ''title'' : The name of the campaign or war, which, if an article about the campaign or war exists, should link to it. Dates should not be indicated unless needed for clarity. Note that long links may cause alignment problems; see [[WP:MILMOS#NAVPROBLEMS|the troubleshooting guide]] for more information.
; ''battles'' : A chronological list of battles and operations in the campaign, linked as <code><nowiki>[[Battle of YYYY|YYYY]]</nowiki></code>. A convenient and accessible way to separate the items in the list is to add <code>| listclass = hlist</code> and then use the standard <kbd>*</kbd> (asterisk)-based [[Help:List|listing format]].
; ''notes'' : (optional) Any explanatory notes needed to clarify the list. This option should be used sparingly.
; (''raw_name'') : (optional; deprecated) This parameter overrides the use of the title in determining the template name and exists for the sake of backward compatibility. When creating a new campaignbox, both title and name should be specified as above and this parameter omitted.
The following optional parameters are passed on to the templates {{tl|Military navigation}} or {{tl|Navbox}} used to create campaignboxes and so can affect their styling. See these two templates' documentation pages for further details.
; ''state'' : To set whether the campaignbox appears fully visible or collapsed (to titlebar only) when it is first presented by a page.
; ''bodyclass'' : CSS styling to affect the whole template.
; ''listclass'' : CSS styling to affect the list of battles, operations, etc. (e.g. to affect {{para|battles}}).
The use of special formatting (such as bolding or changes in font size) in the list of battles{{spaced ndash}}particularly to mark battles as "important"{{spaced ndash}}is generally discouraged; while there are a ''few'' cases where such approaches may be both helpful to the reader and sufficiently well-sourced that they do not constitute original research, they are usually both unnecessary and potentially confusing. Similarly, dividing the list of battles into multiple blocks by inserting heading-like separations should be exceptional; if such a division is felt to be needed, a better solution may be to split the one campaignbox into two or more.<noinclude>
[[Category:WikiProject Military history template instructions|Campaignbox]]
</noinclude><includeonly>{{Sandbox other||
[[Category:Campaignbox templates| ]]
{{#ifeq:{{{noheader|}}}|yes | |
[[Category:Navigational box wrapper templates]]
[[Category:Military navigational boxes|Campaignbox]]
[[Category:Templates that add a category]]
}}}}</includeonly>
05cb24dd8b2b1a78bab960db82b26ce0d68c3063
Template:Operational plan/doc
10
85
176
175
2023-11-27T15:13:29Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox military operation/doc]]
10b255654acded6663dadad8d9084ba41f66bd68
Template:UF-hcal-geo
10
86
178
177
2023-11-27T15:13:29Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
The HTML markup produced by this template includes an [[hCalendar|hCalendar microformat]], which makes the event details [[parsing|parsable]] by computers, either acting automatically to catalogue article across Wikipedia, or via a browser tool operated by a person, to (for example) add the subject to a calendar or diary application. Within the hCalendar is a [[Geo (microformat)|Geo microformat]], which additionally makes the [[geographic coordinate system|coordinates]] (latitude & longitude) parsable, so that they can be, say, looked up on a map, or downloaded to a [[Global Positioning System|GPS]] unit. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
Dates will only be included if you use {{tl|Start date}} or {{tl|End date}} (use the former for single dates, [[Wikipedia:WikiProject Microformats/dates|but do not use any of these if the date is before 1583 CE]]). {{tl|End date}} requires that a time be specified, but display of this time may be suppressed by adding {{para|nodate|yes}} to the end.
To include a URL, use {{tl|URL}}.
hCalendar uses HTML classes including:
{{Flatlist|indent=1|
*attendee
*dtend
*dtstart
*location
*summary
*url
*vevent
}}
Geo is produced by calling {{tl|coord}}, and uses HTML classes:
{{Flatlist|indent=1|
*geo
*latitude
*longitude
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''<br/>Also, when giving coordinates, please don't be [[wikipedia:WikiProject Geographical coordinates#Precision|overly precise]].
<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCalendars and Geo|{{PAGENAME}}]]}} }}</includeonly><noinclude>
[[Category:Microformat (uF) message templates]]
</noinclude>
17ca83a86600e9c6435d5e462efaadfbe2c34b4b
Template:TemplateData header
10
87
180
179
2023-11-27T15:13:30Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<div class="templatedata-header">{{#if:{{{noheader|}}}|<!--
noheader:
-->{{Template parameter usage|based=y}}|<!--
+header:
-->This is the {{#if:{{{nolink|}}}|<!--
+header, nolink TD
-->TemplateData|<!--
+header, +link [[TD]]; DEFAULT:
-->[[Wikipedia:TemplateData|TemplateData]]}}<!--
e.o. #if:nolink; DEFAULT:
--> for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools. {{Template parameter usage|based=y}}<!--
e.o. #if:noheader
-->}}
'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
</div><includeonly><!--
check parameters
-->{{#invoke:Check for unknown parameters|check
|unknown={{template other|1=[[Category:Pages using TemplateData header with unknown parameters|_VALUE_]]}}
|template=Template:TemplateData header
|1 |nolink |noheader
|preview=<div class="error" style="font-weight:normal">Unknown parameter '_VALUE_' in [[Template:TemplateData header]].</div>
}}<!--
-->{{template other|{{sandbox other||
[[Category:Templates using TemplateData]]
}}}}</includeonly><!--
--><noinclude>{{Documentation}}</noinclude>
ddfbb4ae793846b96d4c06330417fa6ed4da2adc
Template:Collapse top
10
88
182
181
2023-11-27T15:13:30Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section -->
{| <!-- Template:Collapse top --> class="mw-collapsible mw-archivedtalk {{<includeonly>safesubst:</includeonly>#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}} {{{class|}}}" style="background: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|Silver}}}; margin: 0.2em auto auto; width:{{<includeonly>safesubst:</includeonly>#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}; padding: 1px;"
|-
! style="background: {{{bg|#{{main other|F0F2F5|CCFFCC}}}}}; font-size:87%; padding:0.2em 0.3em; text-align:{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}|left|{{<includeonly>safesubst:</includeonly>#if:{{{align|}}}|left|center}}}}; {{<includeonly>safesubst:</includeonly>#if:{{{fc|}}}|color: {{{fc}}};|}}" | <div style="font-size:115%;{{<includeonly>safesubst:</includeonly>#if:{{{left|}}}||margin:0 4em}}">{{{1|{{{title|{{{reason|{{{header|{{{heading|{{{result|Extended content}}}}}}}}}}}}}}}}}}</div>
{{<includeonly>safesubst:</includeonly>#if:{{{warning|{{{2|}}}}}}
|{{<includeonly>safesubst:</includeonly>!}}-
{{<includeonly>safesubst:</includeonly>!}} style="text-align:center; font-style:italic;" {{<includeonly>safesubst:</includeonly>!}} {{{2|The following is a closed discussion. {{strongbad|Please do not modify it.}} }}} }}
|-
| style="border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|White}}};" {{<includeonly>safesubst:</includeonly>!}}<noinclude>
{{lorem ipsum|3}}
{{Collapse bottom}}
{{Documentation}}
</noinclude>
247cc43d5198baf8804d0926529cbbdd7be91113
Template:Location map
10
89
184
183
2023-11-27T15:13:31Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Location map|main}}</includeonly><noinclude>{{documentation}}</noinclude>
732416b8068d2dc3549db5aa5ffa786beb502886
Module:Transclusion count
828
90
186
185
2023-11-27T15:13:31Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
local p = {}
function p.fetch(frame)
local template = nil
local return_value = nil
-- Use demo parameter if it exists, otherswise use current template name
local namespace = mw.title.getCurrentTitle().namespace
if frame.args["demo"] and frame.args["demo"] ~= "" then
template = mw.ustring.gsub(frame.args["demo"],"^[Tt]emplate:","")
elseif namespace == 10 then -- Template namespace
template = mw.title.getCurrentTitle().text
elseif namespace == 828 then -- Module namespace
template = (mw.site.namespaces[828].name .. ":" .. mw.title.getCurrentTitle().text)
end
-- If in template or module namespace, look up count in /data
if template ~= nil then
namespace = mw.title.new(template, "Template").namespace
if namespace == 10 or namespace == 828 then
template = mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end
template = mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end
local index = mw.ustring.sub(mw.title.new(template).text,1,1)
local status, data = pcall(function ()
return(mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other")))
end)
if status then
return_value = tonumber(data[mw.ustring.gsub(template, " ", "_")])
end
end
end
-- If database value doesn't exist, use value passed to template
if return_value == nil and frame.args[1] ~= nil then
local arg1=mw.ustring.match(frame.args[1], '[%d,]+')
if arg1 and arg1 ~= '' then
return_value = tonumber(frame:callParserFunction('formatnum', arg1, 'R'))
end
end
return return_value
end
-- Tabulate this data for [[Wikipedia:Database reports/Templates transcluded on the most pages]]
function p.tabulate(frame)
local list = {}
for i = 65, 91 do
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i)))
for name, count in pairs(data) do
table.insert(list, {mw.title.new(name, "Template").fullText, count})
end
end
table.sort(list, function(a, b)
return (a[2] == b[2]) and (a[1] < b[1]) or (a[2] > b[2])
end)
local lang = mw.getContentLanguage();
for i = 1, #list do
list[i] = ('|-\n| %d || [[%s]] || %s\n'):format(i, list[i][1]:gsub('_', ' '), lang:formatNum(list[i][2]))
end
return table.concat(list)
end
return p
000ef6bcbf7b66e727870b0c300c4009da300513
Module:Transclusion count/data/I
828
91
188
187
2023-11-27T15:13:31Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
return {
["IAAF_name"] = 2100,
["IAST"] = 6400,
["IBDB_name"] = 9100,
["ICD10"] = 4700,
["ICD9"] = 4400,
["ICS"] = 2900,
["IDN"] = 3400,
["IMDb_episode"] = 10000,
["IMDb_episodes"] = 2700,
["IMDb_name"] = 154000,
["IMDb_title"] = 190000,
["IMO_Number"] = 4100,
["IMSLP"] = 8300,
["INA"] = 2200,
["IND"] = 7700,
["INR"] = 6600,
["INRConvert"] = 5700,
["INRConvert/CurrentRate"] = 5600,
["INRConvert/USD"] = 5600,
["INRConvert/out"] = 5600,
["IOC_profile"] = 5000,
["IP"] = 2600,
["IPA"] = 143000,
["IPA-de"] = 8100,
["IPA-es"] = 7900,
["IPA-fr"] = 44000,
["IPA-it"] = 6000,
["IPA-nl"] = 3900,
["IPA-pl"] = 4100,
["IPA-pt"] = 3300,
["IPA-sl"] = 6900,
["IPA-th"] = 3000,
["IPA_audio_link"] = 3500,
["IPA_link"] = 3500,
["IPAc-cmn"] = 2300,
["IPAc-en"] = 48000,
["IPAc-pl"] = 51000,
["IPC_athlete"] = 2800,
["IPSummary"] = 78000,
["IP_summary"] = 79000,
["IPtalk"] = 18000,
["IPuser"] = 7100,
["IPvandal"] = 2700,
["IRC"] = 7300,
["IRI"] = 2300,
["IRL"] = 5500,
["IRN"] = 3700,
["ISBN"] = 462000,
["ISBN?"] = 2100,
["ISBNT"] = 39000,
["ISBN_missing"] = 2600,
["ISFDB_name"] = 4100,
["ISFDB_title"] = 4600,
["ISL"] = 2100,
["ISO_15924/script-example-character"] = 2800,
["ISO_15924/wp-article"] = 2800,
["ISO_15924/wp-article/format"] = 2800,
["ISO_15924/wp-article/label"] = 2700,
["ISO_3166_code"] = 521000,
["ISO_3166_name"] = 16000,
["ISO_639_name"] = 8200,
["ISP"] = 5300,
["ISR"] = 4900,
["ISSN"] = 12000,
["ISSN_link"] = 30000,
["ISTAT"] = 8100,
["ISU_figure_skater"] = 2500,
["ITA"] = 17000,
["ITF"] = 6300,
["ITF_profile"] = 9100,
["ITIS"] = 4400,
["ITN_talk"] = 10000,
["ITN_talk/date"] = 10000,
["IUCN_banner"] = 15000,
["I_sup"] = 4600,
["Iaaf_name"] = 7200,
["Ice_hockey"] = 19000,
["Ice_hockey_stats"] = 19000,
["Icehockeystats"] = 12000,
["Icon"] = 582000,
["If"] = 276000,
["If_all"] = 6500,
["If_between"] = 3800,
["If_both"] = 156000,
["If_empty"] = 3680000,
["If_first_display_both"] = 73000,
["If_in_page"] = 10000,
["If_last_display_both"] = 30000,
["If_preview"] = 58000,
["If_then_show"] = 293000,
["Ifempty"] = 4000,
["Ifeq"] = 17000,
["Iferror_then_show"] = 3300,
["Ifexist_not_redirect"] = 1310000,
["Ifnotempty"] = 15000,
["Ifnumber"] = 36000,
["Ifsubst"] = 450000,
["Ih"] = 7500,
["Ill"] = 120000,
["Illm"] = 6700,
["Image_frame"] = 4900,
["Image_label"] = 4500,
["Image_label_begin"] = 3800,
["Image_label_end"] = 3800,
["Image_label_small"] = 2600,
["Image_needed"] = 4500,
["Image_other"] = 272000,
["Image_requested"] = 168000,
["Image_requested/Category_helper"] = 160000,
["Imbox"] = 920000,
["Imdb_name"] = 5400,
["Imdb_title"] = 4000,
["Import_style"] = 11000,
["Import_style/inputbox.css"] = 11000,
["Importance"] = 5650000,
["Importance/colour"] = 5670000,
["Importance_mask"] = 10400000,
["Improve_categories"] = 7100,
["Improve_documentation"] = 2500,
["In_class"] = 5700,
["In_lang"] = 358000,
["In_progress"] = 3300,
["In_string"] = 76000,
["In_title"] = 19000,
["Inactive_userpage_blanked"] = 4900,
["Include-USGov"] = 29000,
["Incomplete_list"] = 23000,
["Inconclusive"] = 2100,
["Increase"] = 43000,
["Incumbent_pope"] = 4300,
["Indent"] = 4400,
["IndexFungorum"] = 2200,
["Indian_English"] = 4300,
["Indian_Rupee"] = 10000,
["Indian_railway_code"] = 3200,
["Inflation"] = 21000,
["Inflation-fn"] = 5400,
["Inflation-year"] = 4500,
["Inflation/IN/startyear"] = 5600,
["Inflation/UK"] = 4400,
["Inflation/UK/dataset"] = 4400,
["Inflation/UK/startyear"] = 4400,
["Inflation/US"] = 12000,
["Inflation/US-GDP"] = 2400,
["Inflation/US-GDP/dataset"] = 2400,
["Inflation/US-GDP/startyear"] = 2400,
["Inflation/US/dataset"] = 12000,
["Inflation/US/startyear"] = 12000,
["Inflation/fn"] = 6300,
["Inflation/year"] = 26000,
["Info"] = 7300,
["Infobox"] = 3240000,
["Infobox/Columns"] = 2400,
["Infobox/mobileviewfix.css"] = 147000,
["Infobox3cols"] = 17000,
["Infobox_AFL_biography"] = 14000,
["Infobox_Aircraft_Begin"] = 5300,
["Infobox_Aircraft_Type"] = 4700,
["Infobox_Athletics_Championships"] = 2700,
["Infobox_Australian_place"] = 15000,
["Infobox_CFL_biography"] = 2200,
["Infobox_COA_wide"] = 3200,
["Infobox_Canada_electoral_district"] = 2500,
["Infobox_Canadian_Football_League_biography"] = 5700,
["Infobox_Canadian_Football_League_biography/position"] = 5700,
["Infobox_Chinese"] = 20000,
["Infobox_Chinese/Chinese"] = 2700,
["Infobox_Chinese/Footer"] = 8700,
["Infobox_Chinese/Header"] = 8700,
["Infobox_Chinese/Korean"] = 17000,
["Infobox_Christian_leader"] = 18000,
["Infobox_French_commune"] = 38000,
["Infobox_GAA_player"] = 2700,
["Infobox_Gaelic_games_player"] = 5000,
["Infobox_German_location"] = 13000,
["Infobox_German_place"] = 14000,
["Infobox_Grand_Prix_race_report"] = 2000,
["Infobox_Greece_place"] = 2800,
["Infobox_Greek_Dimos"] = 2800,
["Infobox_Hindu_temple"] = 2400,
["Infobox_Indian_constituency"] = 4700,
["Infobox_Indian_constituency/defaultdata"] = 4700,
["Infobox_Italian_comune"] = 8100,
["Infobox_Korean_name"] = 15000,
["Infobox_Korean_name/categories"] = 15000,
["Infobox_MLB_yearly"] = 3100,
["Infobox_NASCAR_race_report"] = 2200,
["Infobox_NCAA_team_season"] = 17000,
["Infobox_NFL_biography"] = 28000,
["Infobox_NFL_player"] = 7600,
["Infobox_NFL_team_season"] = 3900,
["Infobox_NRHP"] = 72000,
["Infobox_NRHP/conv"] = 18000,
["Infobox_NRHP/locmapin2region"] = 66000,
["Infobox_Officeholder"] = 4800,
["Infobox_Olympic_event"] = 7300,
["Infobox_Olympic_event/games_text"] = 7300,
["Infobox_Paralympic_event"] = 2600,
["Infobox_Paralympic_event/games_text"] = 2600,
["Infobox_Politician"] = 2200,
["Infobox_Romanian_subdivision"] = 3200,
["Infobox_Russian_district"] = 2000,
["Infobox_Russian_inhabited_locality"] = 4500,
["Infobox_SCOTUS_case"] = 3700,
["Infobox_Site_of_Special_Scientific_Interest"] = 2000,
["Infobox_Swiss_town"] = 2800,
["Infobox_Switzerland_municipality"] = 2900,
["Infobox_Turkey_place"] = 19000,
["Infobox_U.S._county"] = 3000,
["Infobox_U.S._county/district"] = 3000,
["Infobox_UK_constituency"] = 2100,
["Infobox_UK_constituency/year"] = 2100,
["Infobox_UK_legislation"] = 3400,
["Infobox_UK_place"] = 26000,
["Infobox_UK_place/NoDialCode"] = 8100,
["Infobox_UK_place/NoPostCode"] = 3200,
["Infobox_UK_place/area"] = 2400,
["Infobox_UK_place/dist"] = 2500,
["Infobox_UK_place/local"] = 26000,
["Infobox_UK_place/styles.css"] = 26000,
["Infobox_UN_resolution"] = 2300,
["Infobox_US_Supreme_Court_case"] = 3800,
["Infobox_US_Supreme_Court_case/courts"] = 3800,
["Infobox_Wikipedia_user"] = 9800,
["Infobox_YouTube_personality"] = 2700,
["Infobox_YouTube_personality/styles.css"] = 2700,
["Infobox_academic"] = 14000,
["Infobox_aircraft_begin"] = 14000,
["Infobox_aircraft_occurrence"] = 2300,
["Infobox_aircraft_type"] = 13000,
["Infobox_airline"] = 4600,
["Infobox_airport"] = 15000,
["Infobox_airport/datatable"] = 15000,
["Infobox_album"] = 162000,
["Infobox_album/color"] = 192000,
["Infobox_album/link"] = 162000,
["Infobox_anatomy"] = 4500,
["Infobox_ancient_site"] = 5400,
["Infobox_animanga/Footer"] = 6800,
["Infobox_animanga/Header"] = 6900,
["Infobox_animanga/Print"] = 5500,
["Infobox_animanga/Video"] = 4700,
["Infobox_architect"] = 3700,
["Infobox_artist"] = 29000,
["Infobox_artist_discography"] = 5900,
["Infobox_artwork"] = 11000,
["Infobox_athlete"] = 2800,
["Infobox_automobile"] = 8400,
["Infobox_award"] = 13000,
["Infobox_badminton_player"] = 3200,
["Infobox_baseball_biography"] = 28000,
["Infobox_baseball_biography/style"] = 28000,
["Infobox_baseball_biography/styles.css"] = 28000,
["Infobox_basketball_biography"] = 21000,
["Infobox_basketball_biography/style"] = 21000,
["Infobox_basketball_club"] = 3000,
["Infobox_beauty_pageant"] = 2400,
["Infobox_bilateral_relations"] = 4400,
["Infobox_body_of_water"] = 18000,
["Infobox_book"] = 52000,
["Infobox_boxer"] = 5700,
["Infobox_bridge"] = 6000,
["Infobox_building"] = 27000,
["Infobox_character"] = 7500,
["Infobox_chess_biography"] = 4000,
["Infobox_chess_player"] = 3200,
["Infobox_church"] = 15000,
["Infobox_church/denomination"] = 15000,
["Infobox_church/font_color"] = 15000,
["Infobox_civil_conflict"] = 2400,
["Infobox_civilian_attack"] = 5500,
["Infobox_college_coach"] = 12000,
["Infobox_college_football_game"] = 2100,
["Infobox_college_football_player"] = 2000,
["Infobox_college_sports_team_season"] = 40000,
["Infobox_college_sports_team_season/link"] = 40000,
["Infobox_college_sports_team_season/name"] = 40000,
["Infobox_college_sports_team_season/succession"] = 40000,
["Infobox_college_sports_team_season/team"] = 40000,
["Infobox_comic_book_title"] = 3000,
["Infobox_comics_character"] = 3500,
["Infobox_comics_creator"] = 3500,
["Infobox_comics_creator/styles.css"] = 3500,
["Infobox_company"] = 83000,
["Infobox_computing_device"] = 2400,
["Infobox_concert"] = 3300,
["Infobox_constituency"] = 5400,
["Infobox_country"] = 6400,
["Infobox_country/formernext"] = 6000,
["Infobox_country/imagetable"] = 5200,
["Infobox_country/multirow"] = 8300,
["Infobox_country/status_text"] = 2800,
["Infobox_country/styles.css"] = 6500,
["Infobox_country_at_games"] = 15000,
["Infobox_country_at_games/core"] = 15000,
["Infobox_country_at_games/see_also"] = 12000,
["Infobox_court_case"] = 4700,
["Infobox_court_case/images"] = 2400,
["Infobox_cricket_tournament"] = 2300,
["Infobox_cricketer"] = 32000,
["Infobox_cricketer/career"] = 32000,
["Infobox_cricketer/national_side"] = 7500,
["Infobox_criminal"] = 6400,
["Infobox_curler"] = 2600,
["Infobox_cycling_race_report"] = 4500,
["Infobox_cyclist"] = 16000,
["Infobox_dam"] = 5700,
["Infobox_deity"] = 2000,
["Infobox_deity/color"] = 2000,
["Infobox_designation_list"] = 20000,
["Infobox_designation_list/entry"] = 17000,
["Infobox_dim"] = 7000,
["Infobox_dim/core"] = 7000,
["Infobox_diocese"] = 3800,
["Infobox_drug"] = 9800,
["Infobox_drug/chemical_formula"] = 9800,
["Infobox_drug/data_page_link"] = 9800,
["Infobox_drug/formatATC"] = 9700,
["Infobox_drug/formatCASnumber"] = 9800,
["Infobox_drug/formatChEBI"] = 9800,
["Infobox_drug/formatChEMBL"] = 9800,
["Infobox_drug/formatChemDBNIAID"] = 9800,
["Infobox_drug/formatChemSpider"] = 9800,
["Infobox_drug/formatCompTox"] = 9800,
["Infobox_drug/formatDrugBank"] = 9800,
["Infobox_drug/formatIUPHARBPS"] = 9800,
["Infobox_drug/formatJmol"] = 9800,
["Infobox_drug/formatKEGG"] = 9800,
["Infobox_drug/formatPDBligand"] = 9100,
["Infobox_drug/formatPubChemCID"] = 9800,
["Infobox_drug/formatPubChemSID"] = 9800,
["Infobox_drug/formatUNII"] = 9800,
["Infobox_drug/legal_status"] = 10000,
["Infobox_drug/licence"] = 9800,
["Infobox_drug/maintenance_categories"] = 9800,
["Infobox_drug/non-ref-space"] = 4300,
["Infobox_drug/pregnancy_category"] = 9800,
["Infobox_drug/title"] = 9800,
["Infobox_election"] = 30000,
["Infobox_election/row"] = 30000,
["Infobox_election/shortname"] = 28000,
["Infobox_enzyme"] = 5100,
["Infobox_ethnic_group"] = 7300,
["Infobox_event"] = 5400,
["Infobox_family"] = 2200,
["Infobox_figure_skater"] = 4200,
["Infobox_film"] = 157000,
["Infobox_film/short_description"] = 153000,
["Infobox_film_awards"] = 2600,
["Infobox_film_awards/link"] = 2600,
["Infobox_film_awards/style"] = 2600,
["Infobox_food"] = 6900,
["Infobox_football_biography"] = 207000,
["Infobox_football_club"] = 27000,
["Infobox_football_club_season"] = 20000,
["Infobox_football_league"] = 2600,
["Infobox_football_league_season"] = 20000,
["Infobox_football_match"] = 5900,
["Infobox_football_tournament_season"] = 8000,
["Infobox_former_subdivision"] = 3300,
["Infobox_former_subdivision/styles.css"] = 3300,
["Infobox_galaxy"] = 2100,
["Infobox_game"] = 2600,
["Infobox_game_score"] = 3400,
["Infobox_gene"] = 13000,
["Infobox_given_name"] = 4100,
["Infobox_golfer"] = 4400,
["Infobox_golfer/highest_ranking"] = 4400,
["Infobox_government_agency"] = 10000,
["Infobox_government_cabinet"] = 2600,
["Infobox_gridiron_football_person"] = 2400,
["Infobox_gridiron_football_person/position"] = 5700,
["Infobox_gymnast"] = 3500,
["Infobox_handball_biography"] = 4900,
["Infobox_historic_site"] = 12000,
["Infobox_horseraces"] = 2600,
["Infobox_hospital"] = 6300,
["Infobox_hospital/care_system"] = 6300,
["Infobox_hospital/lists"] = 6300,
["Infobox_ice_hockey_biography"] = 20000,
["Infobox_ice_hockey_player"] = 19000,
["Infobox_ice_hockey_team"] = 3000,
["Infobox_ice_hockey_team_season"] = 2000,
["Infobox_international_football_competition"] = 5800,
["Infobox_islands"] = 8900,
["Infobox_islands/area"] = 9300,
["Infobox_islands/density"] = 9300,
["Infobox_islands/length"] = 8900,
["Infobox_islands/styles.css"] = 8900,
["Infobox_journal"] = 9700,
["Infobox_journal/Abbreviation_search"] = 9600,
["Infobox_journal/Bluebook_check"] = 9400,
["Infobox_journal/Former_check"] = 9400,
["Infobox_journal/ISO_4_check"] = 9400,
["Infobox_journal/ISSN-eISSN"] = 9500,
["Infobox_journal/Indexing_search"] = 9500,
["Infobox_journal/MathSciNet_check"] = 9400,
["Infobox_journal/NLM_check"] = 9400,
["Infobox_journal/frequency"] = 8600,
["Infobox_lake"] = 4300,
["Infobox_language"] = 9500,
["Infobox_language/family-color"] = 11000,
["Infobox_language/genetic"] = 6600,
["Infobox_language/linguistlist"] = 9500,
["Infobox_language/ref"] = 7100,
["Infobox_legislature"] = 3700,
["Infobox_library"] = 2200,
["Infobox_lighthouse"] = 2600,
["Infobox_lighthouse/light"] = 2600,
["Infobox_locomotive"] = 4900,
["Infobox_magazine"] = 7600,
["Infobox_manner_of_address"] = 3300,
["Infobox_mapframe"] = 81000,
["Infobox_martial_artist"] = 5700,
["Infobox_martial_artist/record"] = 5700,
["Infobox_medal_templates"] = 424000,
["Infobox_medical_condition"] = 10000,
["Infobox_medical_condition_(new)"] = 8200,
["Infobox_medical_details"] = 2100,
["Infobox_military_conflict"] = 22000,
["Infobox_military_installation"] = 9800,
["Infobox_military_person"] = 45000,
["Infobox_military_unit"] = 26000,
["Infobox_mine"] = 2100,
["Infobox_model"] = 2300,
["Infobox_monument"] = 2000,
["Infobox_mountain"] = 28000,
["Infobox_multi-sport_competition_event"] = 2400,
["Infobox_museum"] = 10000,
["Infobox_musical_artist"] = 122000,
["Infobox_musical_artist/color"] = 122000,
["Infobox_musical_artist/hCard_class"] = 313000,
["Infobox_musical_composition"] = 2900,
["Infobox_name"] = 7500,
["Infobox_name_module"] = 7000,
["Infobox_newspaper"] = 9700,
["Infobox_nobility"] = 2400,
["Infobox_noble"] = 7400,
["Infobox_officeholder"] = 220000,
["Infobox_officeholder/office"] = 226000,
["Infobox_official_post"] = 8100,
["Infobox_organization"] = 36000,
["Infobox_pageant_titleholder"] = 2900,
["Infobox_park"] = 7500,
["Infobox_person"] = 476000,
["Infobox_person/Wikidata"] = 4700,
["Infobox_person/height"] = 103000,
["Infobox_person/length"] = 7000,
["Infobox_person/weight"] = 67000,
["Infobox_philosopher"] = 3400,
["Infobox_planet"] = 4700,
["Infobox_play"] = 3900,
["Infobox_political_party"] = 14000,
["Infobox_power_station"] = 3100,
["Infobox_prepared_food"] = 3100,
["Infobox_professional_wrestler"] = 4300,
["Infobox_professional_wrestling_event"] = 2700,
["Infobox_protected_area"] = 14000,
["Infobox_protein_family"] = 2100,
["Infobox_publisher"] = 2400,
["Infobox_racehorse"] = 5500,
["Infobox_racing_driver"] = 3900,
["Infobox_racing_driver_series_section"] = 2100,
["Infobox_radio_station"] = 22000,
["Infobox_rail"] = 2900,
["Infobox_rail_line"] = 7300,
["Infobox_rail_service"] = 3000,
["Infobox_rail_service/doc"] = 2900,
["Infobox_reality_competition_season"] = 3500,
["Infobox_record_label"] = 4000,
["Infobox_recurring_event"] = 6500,
["Infobox_religious_biography"] = 5300,
["Infobox_religious_building"] = 12000,
["Infobox_religious_building/color"] = 17000,
["Infobox_restaurant"] = 3000,
["Infobox_river"] = 30000,
["Infobox_river/calcunit"] = 30000,
["Infobox_river/discharge"] = 30000,
["Infobox_river/row-style"] = 30000,
["Infobox_river/source"] = 30000,
["Infobox_road"] = 24000,
["Infobox_road/meta/mask/category"] = 24000,
["Infobox_road/meta/mask/country"] = 24000,
["Infobox_road/styles.css"] = 25000,
["Infobox_road_small"] = 2300,
["Infobox_rockunit"] = 6500,
["Infobox_royalty"] = 22000,
["Infobox_royalty/short_description"] = 12000,
["Infobox_rugby_biography"] = 16000,
["Infobox_rugby_biography/correct_date"] = 16000,
["Infobox_rugby_biography/depcheck"] = 16000,
["Infobox_rugby_league_biography"] = 9900,
["Infobox_rugby_league_biography/PLAYER"] = 9800,
["Infobox_rugby_team"] = 2600,
["Infobox_sailboat_specifications"] = 2300,
["Infobox_saint"] = 5000,
["Infobox_school"] = 38000,
["Infobox_school/short_description"] = 38000,
["Infobox_school_district"] = 5700,
["Infobox_school_district/styles.css"] = 5700,
["Infobox_scientist"] = 48000,
["Infobox_service_record"] = 2600,
["Infobox_settlement"] = 562000,
["Infobox_settlement/areadisp"] = 238000,
["Infobox_settlement/columns"] = 95000,
["Infobox_settlement/columns/styles.css"] = 95000,
["Infobox_settlement/densdisp"] = 438000,
["Infobox_settlement/impus"] = 82000,
["Infobox_settlement/lengthdisp"] = 169000,
["Infobox_settlement/link"] = 95000,
["Infobox_settlement/metric"] = 211000,
["Infobox_settlement/pref"] = 293000,
["Infobox_settlement/styles.css"] = 562000,
["Infobox_ship_begin"] = 41000,
["Infobox_ship_career"] = 37000,
["Infobox_ship_characteristics"] = 41000,
["Infobox_ship_class_overview"] = 4100,
["Infobox_ship_image"] = 40000,
["Infobox_shopping_mall"] = 3500,
["Infobox_short_story"] = 2400,
["Infobox_skier"] = 2500,
["Infobox_soap_character"] = 2900,
["Infobox_software"] = 14000,
["Infobox_software/simple"] = 14000,
["Infobox_song"] = 76000,
["Infobox_song/color"] = 76000,
["Infobox_song/link"] = 76000,
["Infobox_spaceflight"] = 3600,
["Infobox_spaceflight/styles.css"] = 3600,
["Infobox_sport_event"] = 2200,
["Infobox_sports_competition_event"] = 18000,
["Infobox_sports_competition_event/medalrow"] = 12000,
["Infobox_sports_league"] = 5000,
["Infobox_sports_season"] = 5500,
["Infobox_sports_team"] = 2200,
["Infobox_sportsperson"] = 106000,
["Infobox_stadium"] = 3500,
["Infobox_station"] = 55000,
["Infobox_station/doc"] = 55000,
["Infobox_station/services"] = 55000,
["Infobox_station/styles.css"] = 55000,
["Infobox_street"] = 3400,
["Infobox_swimmer"] = 9400,
["Infobox_television"] = 57000,
["Infobox_television/Short_description"] = 54000,
["Infobox_television_channel"] = 6200,
["Infobox_television_episode"] = 12000,
["Infobox_television_episode/styles.css"] = 12000,
["Infobox_television_season"] = 9500,
["Infobox_television_station"] = 3700,
["Infobox_tennis_biography"] = 10000,
["Infobox_tennis_event"] = 2500,
["Infobox_tennis_tournament_event"] = 19000,
["Infobox_tennis_tournament_year"] = 9200,
["Infobox_tennis_tournament_year/color"] = 28000,
["Infobox_tennis_tournament_year/footer"] = 28000,
["Infobox_train"] = 2300,
["Infobox_union"] = 2100,
["Infobox_university"] = 26000,
["Infobox_user"] = 2700,
["Infobox_venue"] = 18000,
["Infobox_video_game"] = 28000,
["Infobox_video_game/styles.css"] = 28000,
["Infobox_volleyball_biography"] = 5400,
["Infobox_weapon"] = 7300,
["Infobox_weather_event"] = 2000,
["Infobox_weather_event/Footer"] = 2000,
["Infobox_weather_event/styles.css"] = 2000,
["Infobox_website"] = 7700,
["Infobox_writer"] = 39000,
["Information"] = 101000,
["Information/styles.css"] = 101000,
["Inline_block"] = 4600,
["Inprogress"] = 2400,
["Input_link"] = 32000,
["Instagram"] = 11000,
["Interlanguage_link"] = 157000,
["Interlanguage_link_multi"] = 19000,
["Internet_Archive_author"] = 19000,
["Internet_Archive_film"] = 2500,
["Intitle"] = 12000,
["Invalid_SVG"] = 3500,
["Invalid_SVG/styles.css"] = 3500,
["Iptalk"] = 17000,
["IranCensus2006"] = 46000,
["IranNCSGN"] = 3200,
["Iran_Census_2006"] = 46000,
["Irc"] = 2100,
["Irish_place_name"] = 2700,
["IsIPAddress"] = 37000,
["IsValidPageName"] = 142000,
["Is_country_in_Central_America"] = 13000,
["Is_country_in_the_Caribbean"] = 14000,
["Is_interwiki_link"] = 5900,
["Is_italic_taxon"] = 484000,
["Is_redirect"] = 27000,
["Isbn"] = 7600,
["Isfdb_name"] = 3700,
["Isfdb_title"] = 4400,
["Isnumeric"] = 142000,
["Iso2continent"] = 36000,
["Iso2country"] = 23000,
["Iso2country/article"] = 22000,
["Iso2country/data"] = 23000,
["Iso2nationality"] = 228000,
["Issubst"] = 72000,
["Isu_name"] = 2200,
["Italic_dab2"] = 5300,
["Italic_title"] = 282000,
["Italic_title_prefixed"] = 8700,
["Italics_colon"] = 3800,
["Italictitle"] = 4200,
["Ivm"] = 5700,
["Ivm/styles.css"] = 5700,
["Ivmbox"] = 123000,
["Ivory_messagebox"] = 143000,
["Module:I18n/complex_date"] = 66000,
["Module:IP"] = 132000,
["Module:IPA"] = 143000,
["Module:IPA/data"] = 128000,
["Module:IPA/styles.css"] = 114000,
["Module:IPA_symbol"] = 4800,
["Module:IPA_symbol/data"] = 4800,
["Module:IPAc-en"] = 48000,
["Module:IPAc-en/data"] = 48000,
["Module:IPAc-en/phonemes"] = 48000,
["Module:IPAc-en/pronunciation"] = 48000,
["Module:IPAddress"] = 188000,
["Module:ISO_3166"] = 1040000,
["Module:ISO_3166/data/AT"] = 2500,
["Module:ISO_3166/data/BA"] = 3400,
["Module:ISO_3166/data/CA"] = 2500,
["Module:ISO_3166/data/CN"] = 2100,
["Module:ISO_3166/data/DE"] = 14000,
["Module:ISO_3166/data/ES"] = 3600,
["Module:ISO_3166/data/FR"] = 38000,
["Module:ISO_3166/data/GB"] = 6400,
["Module:ISO_3166/data/GR"] = 3100,
["Module:ISO_3166/data/IN"] = 29000,
["Module:ISO_3166/data/IR"] = 9000,
["Module:ISO_3166/data/National"] = 1040000,
["Module:ISO_3166/data/PL"] = 6700,
["Module:ISO_3166/data/RS"] = 3200,
["Module:ISO_3166/data/RU"] = 25000,
["Module:ISO_3166/data/US"] = 85000,
["Module:ISO_639_name"] = 20000,
["Module:ISOdate"] = 66000,
["Module:Icon"] = 583000,
["Module:Icon/data"] = 583000,
["Module:If_empty"] = 3680000,
["Module:If_in_page"] = 10000,
["Module:If_preview"] = 297000,
["Module:If_preview/configuration"] = 297000,
["Module:If_preview/styles.css"] = 297000,
["Module:Import_style"] = 11000,
["Module:In_lang"] = 358000,
["Module:Indent"] = 4400,
["Module:Infobox"] = 4120000,
["Module:Infobox/dates"] = 69000,
["Module:Infobox/styles.css"] = 4380000,
["Module:Infobox3cols"] = 297000,
["Module:InfoboxImage"] = 4430000,
["Module:Infobox_body_of_water_tracking"] = 18000,
["Module:Infobox_cyclist_tracking"] = 16000,
["Module:Infobox_gene"] = 13000,
["Module:Infobox_mapframe"] = 406000,
["Module:Infobox_military_conflict"] = 22000,
["Module:Infobox_military_conflict/styles.css"] = 22000,
["Module:Infobox_multi-lingual_name"] = 20000,
["Module:Infobox_multi-lingual_name/data"] = 20000,
["Module:Infobox_power_station"] = 3100,
["Module:Infobox_road"] = 25000,
["Module:Infobox_road/browselinks"] = 25000,
["Module:Infobox_road/errors"] = 24000,
["Module:Infobox_road/length"] = 25000,
["Module:Infobox_road/locations"] = 24000,
["Module:Infobox_road/map"] = 25000,
["Module:Infobox_road/route"] = 25000,
["Module:Infobox_road/sections"] = 24000,
["Module:Infobox_television"] = 57000,
["Module:Infobox_television_disambiguation_check"] = 63000,
["Module:Infobox_television_episode"] = 12000,
["Module:Infobox_television_season_disambiguation_check"] = 9000,
["Module:Infobox_television_season_name"] = 9500,
["Module:Internet_Archive"] = 19000,
["Module:IrelandByCountyCatNav"] = 3400,
["Module:Is_infobox_in_lead"] = 378000,
["Module:Is_instance"] = 336000,
["Module:Italic_title"] = 1120000,
["Module:Italic_title2"] = 5300,
}
9332a4674f2c4134e2211474195b4ffb006598c0
Module:Infobox military conflict
828
92
190
189
2023-11-27T15:13:32Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
require('strict')
local infoboxStyle = mw.loadData('Module:WPMILHIST Infobox style')
local templatestyles = 'Module:Infobox military conflict/styles.css'
local IMC = {}
IMC.__index = IMC
function IMC:renderPerCombatant(builder, headerText, prefix, suffix)
prefix = prefix or ''
suffix = suffix or ''
local colspans = {}
-- This may result in colspans[1] getting set twice, but
-- this is no big deal. The second set will be correct.
local lastCombatant = 1
for i = 1,self.combatants do
if self.args[prefix .. i .. suffix] then
colspans[lastCombatant] = i - lastCombatant
lastCombatant = i
end
end
local jointText = self.args[prefix .. (self.combatants + 1) .. suffix]
if headerText and (colspans[1] or jointText) then
builder:tag('tr')
:tag('th')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.header_raw)
:wikitext(headerText)
end
-- The only time colspans[1] wouldn't be set is if no
-- combatant has a field with the given prefix and suffix.
if colspans[1] then
-- Since each found argument set the colspan for the previous
-- one, the final one wasn't set above, so set it now.
colspans[lastCombatant] = self.combatants - lastCombatant + 1
builder = builder:tag('tr')
for i = 1,self.combatants do
-- At this point, colspans[i] will be set for i=1 unconditionally, and for
-- any other value of i where self.args[prefix .. i .. suffix] is set.
if colspans[i] then
builder:tag('td')
-- don't bother emitting colspan="1"
:attr('colspan', colspans[i] ~= 1 and colspans[i] or nil)
:css('width', math.floor(100 / self.combatants * colspans[i] + 0.5) .. '%')
-- no border on the right of the rightmost column
:css('border-right', i ~= lastCombatant and infoboxStyle.internal_border or nil)
-- no padding on the left of the leftmost column
:css('padding-left', i ~= 1 and '0.25em' or nil)
-- don't show the border if we're directly under a header
:css('border-top', not headerText and infoboxStyle.internal_border or nil)
:newline()
:wikitext(self.args[prefix .. i .. suffix])
end
end
end
if jointText then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('text-align', 'center')
-- don't show the border if we're directly under a header
:css('border-top', (not headerText or colspans[1]) and infoboxStyle.internal_border or nil)
:newline()
:wikitext(jointText)
end
end
function IMC:renderHeaderTable(builder)
builder = builder:tag('table')
:css('width', '100%')
:css('margin', 0)
:css('padding', 0)
:css('border', 0)
:css('display', 'inline-table')
if self.args.date then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Date')
:done()
:tag('td')
:wikitext(self.args.date)
end
builder = builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Location')
:done()
:tag('td')
:tag('div')
:addClass('location')
:wikitext(self.args.place or '{{{place}}}') -- hack so that people who don't know Lua know that this parameter is required
:done()
if self.args.coordinates then
builder:wikitext(self.args.coordinates)
end
builder = builder:done():done()
-- only for "Putsch"
if self.args.action then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext(self.args.action and 'Action')
:done()
:tag('td')
:wikitext(self.args.action)
end
if self.args.status or self.args.result then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext(self.args.status and 'Status' or 'Result')
:done()
:tag('td')
:addClass('status')
:newline()
:wikitext(self.args.status or self.args.result)
end
if self.args.territory then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Territorial<br />changes')
:done()
:tag('td')
:newline()
:wikitext(self.args.territory)
end
end
function IMC:render()
local builder = mw.html.create()
if self.args.campaignbox then
-- this should be the same as using {{stack|clear=right|...}}
builder:wikitext(self.frame:expandTemplate{ title = 'stack begin', args = { clear='true'} })
end
builder = builder:tag('table')
:addClass('infobox vevent')
:cssText(infoboxStyle.main_box_raw)
:css('width', self.args.width or nil)
builder:tag('tr')
:tag('th')
:addClass('summary')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.header_raw)
:wikitext(self.args.conflict or mw.title.getCurrentTitle().text)
if self.args.partof then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.sub_header_raw)
:wikitext('Part of ' .. self.args.partof)
end
if self.args.image then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.image_box_raw)
:wikitext(string.format('%s%s%s',
require('Module:InfoboxImage').InfoboxImage{args = {
image = self.args.image,
size = self.args.image_size,
sizedefault = 'frameless',
upright = 1,
alt = self.args.alt
}},
self.args.caption and '<br />' or '',
self.args.caption or ''
))
end
self:renderHeaderTable(builder:tag('tr'):tag('td'):attr('colspan', self.combatants))
self:renderPerCombatant(builder, self.args.combatants_header or 'Belligerents', 'combatant')
-- can be un-hardcoded once gerrit:165108 is merged
for _,v in ipairs{'a','b','c','d'} do
self:renderPerCombatant(builder, nil, 'combatant', v)
end
self:renderPerCombatant(builder, self.args.commanders_header or 'Commanders and leaders', 'commander')
for _,v in ipairs{'a','b','c','d'} do
self:renderPerCombatant(builder, nil, 'commander', v)
end
self:renderPerCombatant(builder, self.args.units_header or 'Units involved', 'units')
self:renderPerCombatant(builder, self.args.strengths_header or 'Strength', 'strength')
self:renderPerCombatant(builder, self.args.polstrengths_header or 'Political support', 'polstrength')
self:renderPerCombatant(builder, self.args.milstrengths_header or 'Military support', 'milstrength')
self:renderPerCombatant(builder, self.args.casualties_header or 'Casualties and losses', 'casualties')
if self.args.notes then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('border-top', infoboxStyle.section_border)
:newline()
:wikitext(self.args.notes)
end
if self.args.map_type then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('border-top', infoboxStyle.internal_border)
:node(require('Module:Location map').main(self.frame, {
self.args.map_type,
relief = self.args.map_relief,
coordinates = self.args.coordinates,
width = self.args.map_size or 220,
float = 'center',
border = 'none',
mark = self.args.map_mark,
marksize = self.args.map_marksize or 8,
label = self.args.map_label,
alt = self.args.map_alt,
caption = self.args.map_caption or ('Location within '
.. (require('Module:Location map').data(self.frame, {self.args.map_type, 'name'})))
}))
end
builder = builder:done()
if self.args.campaignbox then
builder = builder:done()
builder:wikitext(self.args.campaignbox .. self.frame:expandTemplate{ title = 'stack end'})
end
return builder
end
function IMC.new(frame, args)
if not args then
args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:Infobox military conflict'})
end
local obj = {
frame = frame,
args = args
}
-- until gerrit:165108 is merged, there's still a cap on combatants, but as soon as it merges, we can update this little bit of code to uncap it
-- also, don't try to make this more efficient, or references could be in the wrong order
obj.combatants = 2
for _,v in ipairs{'', 'a', 'b', 'c', 'd'} do
for i = 1,5 do
if args['combatant' .. i .. v] then
obj.combatants = math.max(obj.combatants, i)
end
end
end
return setmetatable(obj, IMC)
end
local p = {}
function p.main(frame)
return frame:extensionTag{ name = 'templatestyles', args = { src = templatestyles} } .. tostring(IMC.new(frame):render())
end
return p
737c5c2ab35460ae4165baecc4a140ed140cd602
Module:Coordinates
828
93
192
191
2023-11-27T15:13:32Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
--[[
This module is intended to replace the functionality of {{Coord}} and related
templates. It provides several methods, including
{{#invoke:Coordinates | coord }} : General function formatting and displaying
coordinate values.
{{#invoke:Coordinates | dec2dms }} : Simple function for converting decimal
degree values to DMS format.
{{#invoke:Coordinates | dms2dec }} : Simple function for converting DMS format
to decimal degree format.
{{#invoke:Coordinates | link }} : Export the link used to reach the tools
]]
require('strict')
local math_mod = require("Module:Math")
local coordinates = {};
local isSandbox = mw.getCurrentFrame():getTitle():find('sandbox', 1, true);
local current_page = mw.title.getCurrentTitle()
local page_name = mw.uri.encode( current_page.prefixedText, 'WIKI' );
local coord_link = 'https://geohack.toolforge.org/geohack.php?pagename=' .. page_name .. '¶ms='
--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(coords)
return mw.getCurrentFrame():extensionTag{
name = 'indicator',
args = { name = 'coordinates' },
content = '<span id="coordinates">[[Geographic coordinate system|Coordinates]]: ' .. coords .. '</span>'
}
end
--[[ Helper function, used in detecting DMS formatting ]]
local function dmsTest(first, second)
if type(first) ~= 'string' or type(second) ~= 'string' then
return nil
end
local s = (first .. second):upper()
return s:find('^[NS][EW]$') or s:find('^[EW][NS]$')
end
--[[ Wrapper function to grab args, see Module:Arguments for this function's documentation. ]]
local function makeInvokeFunc(funcName)
return function (frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Coord'
})
return coordinates[funcName](args, frame)
end
end
--[[ Helper function, handle optional args. ]]
local function optionalArg(arg, supplement)
return arg and arg .. supplement or ''
end
--[[
Formats any error messages generated for display
]]
local function errorPrinter(errors)
local result = ""
for i,v in ipairs(errors) do
result = result .. '<strong class="error">Coordinates: ' .. v[2] .. '</strong><br />'
end
return result
end
--[[
Determine the required CSS class to display coordinates
Usually geo-nondefault is hidden by CSS, unless a user has overridden this for himself
default is the mode as specificied by the user when calling the {{coord}} template
mode is the display mode (dec or dms) that we will need to determine the css class for
]]
local function displayDefault(default, mode)
if default == "" then
default = "dec"
end
if default == mode then
return "geo-default"
else
return "geo-nondefault"
end
end
--[[
specPrinter
Output formatter. Takes the structure generated by either parseDec
or parseDMS and formats it for inclusion on Wikipedia.
]]
local function specPrinter(args, coordinateSpec)
local uriComponents = coordinateSpec["param"]
if uriComponents == "" then
-- RETURN error, should never be empty or nil
return "ERROR param was empty"
end
if args["name"] then
uriComponents = uriComponents .. "&title=" .. mw.uri.encode(coordinateSpec["name"])
end
local geodmshtml = '<span class="geo-dms" title="Maps, aerial photos, and other data for this location">'
.. '<span class="latitude">' .. coordinateSpec["dms-lat"] .. '</span> '
.. '<span class="longitude">' ..coordinateSpec["dms-long"] .. '</span>'
.. '</span>'
local lat = tonumber( coordinateSpec["dec-lat"] ) or 0
local geodeclat
if lat < 0 then
-- FIXME this breaks the pre-existing precision
geodeclat = tostring(coordinateSpec["dec-lat"]):sub(2) .. "ยฐS"
else
geodeclat = (coordinateSpec["dec-lat"] or 0) .. "ยฐN"
end
local long = tonumber( coordinateSpec["dec-long"] ) or 0
local geodeclong
if long < 0 then
-- FIXME does not handle unicode minus
geodeclong = tostring(coordinateSpec["dec-long"]):sub(2) .. "ยฐW"
else
geodeclong = (coordinateSpec["dec-long"] or 0) .. "ยฐE"
end
local geodechtml = '<span class="geo-dec" title="Maps, aerial photos, and other data for this location">'
.. geodeclat .. ' '
.. geodeclong
.. '</span>'
local geonumhtml = '<span class="geo">'
.. coordinateSpec["dec-lat"] .. '; '
.. coordinateSpec["dec-long"]
.. '</span>'
local inner = '<span class="' .. displayDefault(coordinateSpec["default"], "dms" ) .. '">' .. geodmshtml .. '</span>'
.. '<span class="geo-multi-punct"> / </span>'
.. '<span class="' .. displayDefault(coordinateSpec["default"], "dec" ) .. '">';
if not args["name"] then
inner = inner .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span></span>'
else
inner = inner .. '<span class="vcard">' .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span>'
.. '<span style="display:none"> (<span class="fn org">'
.. args["name"] .. '</span>)</span></span></span>'
end
local stylesheetLink = 'Module:Coordinates' .. ( isSandbox and '/sandbox' or '' ) .. '/styles.css'
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = stylesheetLink }
} .. '<span class="plainlinks nourlexpansion">[' .. coord_link .. uriComponents ..
' ' .. inner .. ']</span>'
end
--[[ Helper function, convert decimal to degrees ]]
local function convert_dec2dms_d(coordinate)
local d = math_mod._round( coordinate, 0 ) .. "ยฐ"
return d .. ""
end
--[[ Helper function, convert decimal to degrees and minutes ]]
local function convert_dec2dms_dm(coordinate)
coordinate = math_mod._round( coordinate * 60, 0 );
local m = coordinate % 60;
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."ยฐ"
return d .. string.format( "%02dโฒ", m )
end
--[[ Helper function, convert decimal to degrees, minutes, and seconds ]]
local function convert_dec2dms_dms(coordinate)
coordinate = math_mod._round( coordinate * 60 * 60, 0 );
local s = coordinate % 60
coordinate = math.floor( (coordinate - s) / 60 );
local m = coordinate % 60
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."ยฐ"
return d .. string.format( "%02dโฒ", m ) .. string.format( "%02dโณ", s )
end
--[[
Helper function, convert decimal latitude or longitude to
degrees, minutes, and seconds format based on the specified precision.
]]
local function convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
local coord = tonumber(coordinate)
local postfix
if coord >= 0 then
postfix = firstPostfix
else
postfix = secondPostfix
end
precision = precision:lower();
if precision == "dms" then
return convert_dec2dms_dms( math.abs( coord ) ) .. postfix;
elseif precision == "dm" then
return convert_dec2dms_dm( math.abs( coord ) ) .. postfix;
elseif precision == "d" then
return convert_dec2dms_d( math.abs( coord ) ) .. postfix;
end
end
--[[
Convert DMS format into a N or E decimal coordinate
]]
local function convert_dms2dec(direction, degrees_str, minutes_str, seconds_str)
local degrees = tonumber(degrees_str)
local minutes = tonumber(minutes_str) or 0
local seconds = tonumber(seconds_str) or 0
local factor = 1
if direction == "S" or direction == "W" then
factor = -1
end
local precision = 0
if seconds_str then
precision = 5 + math.max( math_mod._precision(seconds_str), 0 );
elseif minutes_str and minutes_str ~= '' then
precision = 3 + math.max( math_mod._precision(minutes_str), 0 );
else
precision = math.max( math_mod._precision(degrees_str), 0 );
end
local decimal = factor * (degrees+(minutes+seconds/60)/60)
return string.format( "%." .. precision .. "f", decimal ) -- not tonumber since this whole thing is string based.
end
--[[
Checks input values to for out of range errors.
]]
local function validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, source, strong )
local errors = {};
lat_d = tonumber( lat_d ) or 0;
lat_m = tonumber( lat_m ) or 0;
lat_s = tonumber( lat_s ) or 0;
long_d = tonumber( long_d ) or 0;
long_m = tonumber( long_m ) or 0;
long_s = tonumber( long_s ) or 0;
if strong then
if lat_d < 0 then
table.insert(errors, {source, "latitude degrees < 0 with hemisphere flag"})
end
if long_d < 0 then
table.insert(errors, {source, "longitude degrees < 0 with hemisphere flag"})
end
--[[
#coordinates is inconsistent about whether this is an error. If globe: is
specified, it won't error on this condition, but otherwise it will.
For not simply disable this check.
if long_d > 180 then
table.insert(errors, {source, "longitude degrees > 180 with hemisphere flag"})
end
]]
end
if lat_d > 90 then
table.insert(errors, {source, "latitude degrees > 90"})
end
if lat_d < -90 then
table.insert(errors, {source, "latitude degrees < -90"})
end
if lat_m >= 60 then
table.insert(errors, {source, "latitude minutes >= 60"})
end
if lat_m < 0 then
table.insert(errors, {source, "latitude minutes < 0"})
end
if lat_s >= 60 then
table.insert(errors, {source, "latitude seconds >= 60"})
end
if lat_s < 0 then
table.insert(errors, {source, "latitude seconds < 0"})
end
if long_d >= 360 then
table.insert(errors, {source, "longitude degrees >= 360"})
end
if long_d <= -360 then
table.insert(errors, {source, "longitude degrees <= -360"})
end
if long_m >= 60 then
table.insert(errors, {source, "longitude minutes >= 60"})
end
if long_m < 0 then
table.insert(errors, {source, "longitude minutes < 0"})
end
if long_s >= 60 then
table.insert(errors, {source, "longitude seconds >= 60"})
end
if long_s < 0 then
table.insert(errors, {source, "longitude seconds < 0"})
end
return errors;
end
--[[
parseDec
Transforms decimal format latitude and longitude into the
structure to be used in displaying coordinates
]]
local function parseDec( lat, long, format )
local coordinateSpec = {}
local errors = {}
if not long then
return nil, {{"parseDec", "Missing longitude"}}
elseif not tonumber(long) then
return nil, {{"parseDec", "Longitude could not be parsed as a number: " .. long}}
end
errors = validate( lat, nil, nil, long, nil, nil, 'parseDec', false );
coordinateSpec["dec-lat"] = lat;
coordinateSpec["dec-long"] = long;
local mode = coordinates.determineMode( lat, long );
coordinateSpec["dms-lat"] = convert_dec2dms( lat, "N", "S", mode) -- {{coord/dec2dms|{{{1}}}|N|S|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
coordinateSpec["dms-long"] = convert_dec2dms( long, "E", "W", mode) -- {{coord/dec2dms|{{{2}}}|E|W|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dec"
end
return coordinateSpec, errors
end
--[[
parseDMS
Transforms degrees, minutes, seconds format latitude and longitude
into the a structure to be used in displaying coordinates
]]
local function parseDMS( lat_d, lat_m, lat_s, lat_f, long_d, long_m, long_s, long_f, format )
local coordinateSpec, errors, backward = {}, {}
lat_f = lat_f:upper();
long_f = long_f:upper();
-- Check if specified backward
if lat_f == 'E' or lat_f == 'W' then
lat_d, long_d, lat_m, long_m, lat_s, long_s, lat_f, long_f, backward = long_d, lat_d, long_m, lat_m, long_s, lat_s, long_f, lat_f, true;
end
errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true );
if not long_d then
return nil, {{"parseDMS", "Missing longitude" }}
elseif not tonumber(long_d) then
return nil, {{"parseDMS", "Longitude could not be parsed as a number:" .. long_d }}
end
if not lat_m and not lat_s and not long_m and not long_s and #errors == 0 then
if math_mod._precision( lat_d ) > 0 or math_mod._precision( long_d ) > 0 then
if lat_f:upper() == 'S' then
lat_d = '-' .. lat_d;
end
if long_f:upper() == 'W' then
long_d = '-' .. long_d;
end
return parseDec( lat_d, long_d, format );
end
end
coordinateSpec["dms-lat"] = lat_d.."ยฐ"..optionalArg(lat_m,"โฒ") .. optionalArg(lat_s,"โณ") .. lat_f
coordinateSpec["dms-long"] = long_d.."ยฐ"..optionalArg(long_m,"โฒ") .. optionalArg(long_s,"โณ") .. long_f
coordinateSpec["dec-lat"] = convert_dms2dec(lat_f, lat_d, lat_m, lat_s) -- {{coord/dms2dec|{{{4}}}|{{{1}}}|0{{{2}}}|0{{{3}}}}}
coordinateSpec["dec-long"] = convert_dms2dec(long_f, long_d, long_m, long_s) -- {{coord/dms2dec|{{{8}}}|{{{5}}}|0{{{6}}}|0{{{7}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dms"
end
return coordinateSpec, errors, backward
end
--[[
Check the input arguments for coord to determine the kind of data being provided
and then make the necessary processing.
]]
local function formatTest(args)
local result, errors
local backward, primary = false, false
local function getParam(args, lim)
local ret = {}
for i = 1, lim do
ret[i] = args[i] or ''
end
return table.concat(ret, '_')
end
if not args[1] then
-- no lat logic
return errorPrinter( {{"formatTest", "Missing latitude"}} )
elseif not tonumber(args[1]) then
-- bad lat logic
return errorPrinter( {{"formatTest", "Unable to parse latitude as a number:" .. args[1]}} )
elseif not args[4] and not args[5] and not args[6] then
-- dec logic
result, errors = parseDec(args[1], args[2], args.format)
if not result then
return errorPrinter(errors);
end
-- formatting for geohack: geohack expects D_N_D_E notation or D;D notation
-- wikiminiatlas doesn't support D;D notation
-- #coordinates parserfunction doesn't support negative decimals with NSWE
result.param = table.concat({
math.abs(tonumber(args[1])),
((tonumber(args[1]) or 0) < 0) and 'S' or 'N',
math.abs(tonumber(args[2])),
((tonumber(args[2]) or 0) < 0) and 'W' or 'E',
args[3] or ''}, '_')
elseif dmsTest(args[4], args[8]) then
-- dms logic
result, errors, backward = parseDMS(args[1], args[2], args[3], args[4],
args[5], args[6], args[7], args[8], args.format)
if args[10] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 9)
elseif dmsTest(args[3], args[6]) then
-- dm logic
result, errors, backward = parseDMS(args[1], args[2], nil, args[3],
args[4], args[5], nil, args[6], args['format'])
if args[8] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 7)
elseif dmsTest(args[2], args[4]) then
-- d logic
result, errors, backward = parseDMS(args[1], nil, nil, args[2],
args[3], nil, nil, args[4], args.format)
if args[6] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 5)
else
-- Error
return errorPrinter({{"formatTest", "Unknown argument format"}}) .. '[[Category:Pages with malformed coordinate tags]]'
end
result.name = args.name
local extra_param = {'dim', 'globe', 'scale', 'region', 'source', 'type'}
for _, v in ipairs(extra_param) do
if args[v] then
table.insert(errors, {'formatTest', 'Parameter: "' .. v .. '=" should be "' .. v .. ':"' })
end
end
local ret = specPrinter(args, result)
if #errors > 0 then
ret = ret .. ' ' .. errorPrinter(errors) .. '[[Category:Pages with malformed coordinate tags]]'
end
return ret, backward
end
--[[
Generate Wikidata tracking categories.
]]
local function makeWikidataCategories(qid)
local ret
local qid = qid or mw.wikibase.getEntityIdForCurrentPage()
if mw.wikibase and current_page.namespace == 0 then
if qid and mw.wikibase.entityExists(qid) and mw.wikibase.getBestStatements(qid, "P625") and mw.wikibase.getBestStatements(qid, "P625")[1] then
local snaktype = mw.wikibase.getBestStatements(qid, "P625")[1].mainsnak.snaktype
if snaktype == 'value' then
-- coordinates exist both here and on Wikidata, and can be compared.
ret = 'Coordinates on Wikidata'
elseif snaktype == 'somevalue' then
ret = 'Coordinates on Wikidata set to unknown value'
elseif snaktype == 'novalue' then
ret = 'Coordinates on Wikidata set to no value'
end
else
-- We have to either import the coordinates to Wikidata or remove them here.
ret = 'Coordinates not on Wikidata'
end
end
if ret then
return string.format('[[Category:%s]]', ret)
else
return ''
end
end
--[[
link
Simple function to export the coordinates link for other uses.
Usage:
{{#invoke:Coordinates | link }}
]]
function coordinates.link(frame)
return coord_link;
end
--[[
dec2dms
Wrapper to allow templates to call dec2dms directly.
Usage:
{{#invoke:Coordinates | dec2dms | decimal_coordinate | positive_suffix |
negative_suffix | precision }}
decimal_coordinate is converted to DMS format. If positive, the positive_suffix
is appended (typical N or E), if negative, the negative suffix is appended. The
specified precision is one of 'D', 'DM', or 'DMS' to specify the level of detail
to use.
]]
coordinates.dec2dms = makeInvokeFunc('_dec2dms')
function coordinates._dec2dms(args)
local coordinate = args[1]
local firstPostfix = args[2] or ''
local secondPostfix = args[3] or ''
local precision = args[4] or ''
return convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
end
--[[
Helper function to determine whether to use D, DM, or DMS
format depending on the precision of the decimal input.
]]
function coordinates.determineMode( value1, value2 )
local precision = math.max( math_mod._precision( value1 ), math_mod._precision( value2 ) );
if precision <= 0 then
return 'd'
elseif precision <= 2 then
return 'dm';
else
return 'dms';
end
end
--[[
dms2dec
Wrapper to allow templates to call dms2dec directly.
Usage:
{{#invoke:Coordinates | dms2dec | direction_flag | degrees |
minutes | seconds }}
Converts DMS values specified as degrees, minutes, seconds too decimal format.
direction_flag is one of N, S, E, W, and determines whether the output is
positive (i.e. N and E) or negative (i.e. S and W).
]]
coordinates.dms2dec = makeInvokeFunc('_dms2dec')
function coordinates._dms2dec(args)
local direction = args[1]
local degrees = args[2]
local minutes = args[3]
local seconds = args[4]
return convert_dms2dec(direction, degrees, minutes, seconds)
end
--[[
coord
Main entry point for Lua function to replace {{coord}}
Usage:
{{#invoke:Coordinates | coord }}
{{#invoke:Coordinates | coord | lat | long }}
{{#invoke:Coordinates | coord | lat | lat_flag | long | long_flag }}
...
Refer to {{coord}} documentation page for many additional parameters and
configuration options.
Note: This function provides the visual display elements of {{coord}}. In
order to load coordinates into the database, the {{#coordinates:}} parser
function must also be called, this is done automatically in the Lua
version of {{coord}}.
]]
coordinates.coord = makeInvokeFunc('_coord')
function coordinates._coord(args)
if not tonumber(args[1]) and not args[2] then
args[3] = args[1]; args[1] = nil
local entity = mw.wikibase.getEntityObject(args.qid)
if entity
and entity.claims
and entity.claims.P625
and entity.claims.P625[1].mainsnak.snaktype == 'value'
then
local precision = entity.claims.P625[1].mainsnak.datavalue.value.precision
args[1] = entity.claims.P625[1].mainsnak.datavalue.value.latitude
args[2] = entity.claims.P625[1].mainsnak.datavalue.value.longitude
if precision then
precision = -math_mod._round(math.log(precision)/math.log(10),0)
args[1] = math_mod._round(args[1],precision)
args[2] = math_mod._round(args[2],precision)
end
end
end
local contents, backward = formatTest(args)
local Notes = args.notes or ''
local Display = args.display and args.display:lower() or 'inline'
-- it and ti are short for inline,title and title,inline
local function isInline(s)
-- Finds whether coordinates are displayed inline.
return s:find('inline') ~= nil or s == 'i' or s == 'it' or s == 'ti'
end
local function isInTitle(s)
-- Finds whether coordinates are displayed in the title.
return s:find('title') ~= nil or s == 't' or s == 'it' or s == 'ti'
end
local function coord_wrapper(in_args)
-- Calls the parser function {{#coordinates:}}.
return mw.getCurrentFrame():callParserFunction('#coordinates', in_args) or ''
end
local text = ''
if isInline(Display) then
text = text .. '<span class="geo-inline">' .. contents .. Notes .. '</span>'
end
if isInTitle(Display) then
-- Add to output since indicator content is invisible to Lua later on
if not isInline(Display) then
text = text .. '<span class="geo-inline-hidden noexcerpt">' .. contents .. Notes .. '</span>'
end
text = text .. displaytitle(contents .. Notes) .. makeWikidataCategories(args.qid)
end
if not args.nosave then
local page_title, count = mw.title.getCurrentTitle(), 1
if backward then
local tmp = {}
while not string.find((args[count-1] or ''), '[EW]') do tmp[count] = (args[count] or ''); count = count+1 end
tmp.count = count; count = 2*(count-1)
while count >= tmp.count do table.insert(tmp, 1, (args[count] or '')); count = count-1 end
for i, v in ipairs(tmp) do args[i] = v end
else
while count <= 9 do args[count] = (args[count] or ''); count = count+1 end
end
if isInTitle(Display) and not page_title.isTalkPage and page_title.subpageText ~= 'doc' and page_title.subpageText ~= 'testcases' then args[10] = 'primary' end
args.notes, args.format, args.display = nil
text = text .. coord_wrapper(args)
end
return text
end
--[[
coord2text
Extracts a single value from a transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coord2text | {{Coord}} | parameter }}
Valid values for the second parameter are: lat (signed integer), long (signed integer), type, scale, dim, region, globe, source
]]
function coordinates._coord2text(coord,type)
if coord == '' or type == '' or not type then return nil end
type = mw.text.trim(type)
if type == 'lat' or type == 'long' then
local result, negative = mw.text.split((mw.ustring.match(coord,'[%.%d]+ยฐ[NS] [%.%d]+ยฐ[EW]') or ''), ' ')
if type == 'lat' then
result, negative = result[1], 'S'
else
result, negative = result[2], 'W'
end
result = mw.text.split(result, 'ยฐ')
if result[2] == negative then result[1] = '-'..result[1] end
return result[1]
else
return mw.ustring.match(coord, 'params=.-_' .. type .. ':(.-)[ _]')
end
end
function coordinates.coord2text(frame)
return coordinates._coord2text(frame.args[1],frame.args[2])
end
--[[
coordinsert
Injects some text into the Geohack link of a transclusion of {{Coord}} (if that text isn't already in the transclusion). Outputs the modified transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coordinsert | {{Coord}} | parameter:value | parameter:value | โฆ }}
Do not make Geohack unhappy by inserting something which isn't mentioned in the {{Coord}} documentation.
]]
function coordinates.coordinsert(frame)
-- for the 2nd or later integer parameter (the first is the coord template, as above)
for i, v in ipairs(frame.args) do
if i ~= 1 then
-- if we cannot find in the coord_template the i_th coordinsert parameter e.g. region
if not mw.ustring.find(frame.args[1], (mw.ustring.match(frame.args[i], '^(.-:)') or '')) then
-- find from the params= up to the first possibly-present underscore
-- and append the i_th coordinsert parameter and a space
-- IDK why we're adding a space but it does seem somewhat convenient
frame.args[1] = mw.ustring.gsub(frame.args[1], '(params=.-)_? ', '%1_'..frame.args[i]..' ')
end
end
end
if frame.args.name then
-- if we can't find the vcard class
if not mw.ustring.find(frame.args[1], '<span class="vcard">') then
-- take something that looks like a coord template and add the vcard span with class and fn org class
local namestr = frame.args.name
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(<span class="geo%-default">)(<span[^<>]*>[^<>]*</span><span[^<>]*>[^<>]*<span[^<>]*>[^<>]*</span></span>)(</span>)',
'%1<span class="vcard">%2<span style="display:none"> (<span class="fn org">' .. namestr .. '</span>)</span></span>%3'
)
-- then find anything from coordinates parameters to the 'end' and attach the title parameter
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(¶ms=[^&"<>%[%] ]*) ',
'%1&title=' .. mw.uri.encode(namestr) .. ' '
)
end
end
-- replace the existing indicator with a new indicator using the modified content
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(<span class="geo%-inline[^"]*">(.+)</span>)\127[^\127]*UNIQ%-%-indicator%-%x+%-%-?QINU[^\127]*\127',
function (inline, coord) return inline .. displaytitle(coord) end
)
return frame.args[1]
end
return coordinates
6162d7e98fcf6faab5809049e0a48bb3e67d88e3
Module:Math
828
94
194
193
2023-11-27T15:13:33Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
--[[
This module provides a number of basic mathematical operations.
]]
local yesno, getArgs -- lazily initialized
local p = {} -- Holds functions to be returned from #invoke, and functions to make available to other Lua modules.
local wrap = {} -- Holds wrapper functions that process arguments from #invoke. These act as intemediary between functions meant for #invoke and functions meant for Lua.
--[[
Helper functions used to avoid redundant code.
]]
local function err(msg)
-- Generates wikitext error messages.
return mw.ustring.format('<strong class="error">Formatting error: %s</strong>', msg)
end
local function unpackNumberArgs(args)
-- Returns an unpacked list of arguments specified with numerical keys.
local ret = {}
for k, v in pairs(args) do
if type(k) == 'number' then
table.insert(ret, v)
end
end
return unpack(ret)
end
local function makeArgArray(...)
-- Makes an array of arguments from a list of arguments that might include nils.
local args = {...} -- Table of arguments. It might contain nils or non-number values, so we can't use ipairs.
local nums = {} -- Stores the numbers of valid numerical arguments.
local ret = {}
for k, v in pairs(args) do
v = p._cleanNumber(v)
if v then
nums[#nums + 1] = k
args[k] = v
end
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[#ret + 1] = args[num]
end
return ret
end
local function fold(func, ...)
-- Use a function on all supplied arguments, and return the result. The function must accept two numbers as parameters,
-- and must return a number as an output. This number is then supplied as input to the next function call.
local vals = makeArgArray(...)
local count = #vals -- The number of valid arguments
if count == 0 then return
-- Exit if we have no valid args, otherwise removing the first arg would cause an error.
nil, 0
end
local ret = table.remove(vals, 1)
for _, val in ipairs(vals) do
ret = func(ret, val)
end
return ret, count
end
--[[
Fold arguments by selectively choosing values (func should return when to choose the current "dominant" value).
]]
local function binary_fold(func, ...)
local value = fold((function(a, b) if func(a, b) then return a else return b end end), ...)
return value
end
--[[
random
Generate a random number
Usage:
{{#invoke: Math | random }}
{{#invoke: Math | random | maximum value }}
{{#invoke: Math | random | minimum value | maximum value }}
]]
function wrap.random(args)
local first = p._cleanNumber(args[1])
local second = p._cleanNumber(args[2])
return p._random(first, second)
end
function p._random(first, second)
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))
-- math.random will throw an error if given an explicit nil parameter, so we need to use if statements to check the params.
if first and second then
if first <= second then -- math.random doesn't allow the first number to be greater than the second.
return math.random(first, second)
end
elseif first then
return math.random(first)
else
return math.random()
end
end
--[[
order
Determine order of magnitude of a number
Usage:
{{#invoke: Math | order | value }}
]]
function wrap.order(args)
local input_string = (args[1] or args.x or '0');
local input_number = p._cleanNumber(input_string);
if input_number == nil then
return err('order of magnitude input appears non-numeric')
else
return p._order(input_number)
end
end
function p._order(x)
if x == 0 then return 0 end
return math.floor(math.log10(math.abs(x)))
end
--[[
precision
Detemines the precision of a number using the string representation
Usage:
{{ #invoke: Math | precision | value }}
]]
function wrap.precision(args)
local input_string = (args[1] or args.x or '0');
local trap_fraction = args.check_fraction;
local input_number;
if not yesno then
yesno = require('Module:Yesno')
end
if yesno(trap_fraction, true) then -- Returns true for all input except nil, false, "no", "n", "0" and a few others. See [[Module:Yesno]].
local pos = string.find(input_string, '/', 1, true);
if pos ~= nil then
if string.find(input_string, '/', pos + 1, true) == nil then
local denominator = string.sub(input_string, pos+1, -1);
local denom_value = tonumber(denominator);
if denom_value ~= nil then
return math.log10(denom_value);
end
end
end
end
input_number, input_string = p._cleanNumber(input_string);
if input_string == nil then
return err('precision input appears non-numeric')
else
return p._precision(input_string)
end
end
function p._precision(x)
if type(x) == 'number' then
x = tostring(x)
end
x = string.upper(x)
local decimal = x:find('%.')
local exponent_pos = x:find('E')
local result = 0;
if exponent_pos ~= nil then
local exponent = string.sub(x, exponent_pos + 1)
x = string.sub(x, 1, exponent_pos - 1)
result = result - tonumber(exponent)
end
if decimal ~= nil then
result = result + string.len(x) - decimal
return result
end
local pos = string.len(x);
while x:byte(pos) == string.byte('0') do
pos = pos - 1
result = result - 1
if pos <= 0 then
return 0
end
end
return result
end
--[[
max
Finds the maximum argument
Usage:
{{#invoke:Math| max | value1 | value2 | ... }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.max(args)
return p._max(unpackNumberArgs(args))
end
function p._max(...)
local max_value = binary_fold((function(a, b) return a > b end), ...)
if max_value then
return max_value
end
end
--[[
median
Find the median of set of numbers
Usage:
{{#invoke:Math | median | number1 | number2 | ...}}
OR
{{#invoke:Math | median }}
]]
function wrap.median(args)
return p._median(unpackNumberArgs(args))
end
function p._median(...)
local vals = makeArgArray(...)
local count = #vals
table.sort(vals)
if count == 0 then
return 0
end
if p._mod(count, 2) == 0 then
return (vals[count/2] + vals[count/2+1])/2
else
return vals[math.ceil(count/2)]
end
end
--[[
min
Finds the minimum argument
Usage:
{{#invoke:Math| min | value1 | value2 | ... }}
OR
{{#invoke:Math| min }}
When used with no arguments, it takes its input from the parent
frame. Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.min(args)
return p._min(unpackNumberArgs(args))
end
function p._min(...)
local min_value = binary_fold((function(a, b) return a < b end), ...)
if min_value then
return min_value
end
end
--[[
sum
Finds the sum
Usage:
{{#invoke:Math| sum | value1 | value2 | ... }}
OR
{{#invoke:Math| sum }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.sum(args)
return p._sum(unpackNumberArgs(args))
end
function p._sum(...)
local sums, count = fold((function(a, b) return a + b end), ...)
if not sums then
return 0
else
return sums
end
end
--[[
average
Finds the average
Usage:
{{#invoke:Math| average | value1 | value2 | ... }}
OR
{{#invoke:Math| average }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.average(args)
return p._average(unpackNumberArgs(args))
end
function p._average(...)
local sum, count = fold((function(a, b) return a + b end), ...)
if not sum then
return 0
else
return sum / count
end
end
--[[
round
Rounds a number to specified precision
Usage:
{{#invoke:Math | round | value | precision }}
--]]
function wrap.round(args)
local value = p._cleanNumber(args[1] or args.value or 0)
local precision = p._cleanNumber(args[2] or args.precision or 0)
if value == nil or precision == nil then
return err('round input appears non-numeric')
else
return p._round(value, precision)
end
end
function p._round(value, precision)
local rescale = math.pow(10, precision or 0);
return math.floor(value * rescale + 0.5) / rescale;
end
--[[
log10
returns the log (base 10) of a number
Usage:
{{#invoke:Math | log10 | x }}
]]
function wrap.log10(args)
return math.log10(args[1])
end
--[[
mod
Implements the modulo operator
Usage:
{{#invoke:Math | mod | x | y }}
--]]
function wrap.mod(args)
local x = p._cleanNumber(args[1])
local y = p._cleanNumber(args[2])
if not x then
return err('first argument to mod appears non-numeric')
elseif not y then
return err('second argument to mod appears non-numeric')
else
return p._mod(x, y)
end
end
function p._mod(x, y)
local ret = x % y
if not (0 <= ret and ret < y) then
ret = 0
end
return ret
end
--[[
gcd
Calculates the greatest common divisor of multiple numbers
Usage:
{{#invoke:Math | gcd | value 1 | value 2 | value 3 | ... }}
--]]
function wrap.gcd(args)
return p._gcd(unpackNumberArgs(args))
end
function p._gcd(...)
local function findGcd(a, b)
local r = b
local oldr = a
while r ~= 0 do
local quotient = math.floor(oldr / r)
oldr, r = r, oldr - quotient * r
end
if oldr < 0 then
oldr = oldr * -1
end
return oldr
end
local result, count = fold(findGcd, ...)
return result
end
--[[
precision_format
Rounds a number to the specified precision and formats according to rules
originally used for {{template:Rnd}}. Output is a string.
Usage:
{{#invoke: Math | precision_format | number | precision }}
]]
function wrap.precision_format(args)
local value_string = args[1] or 0
local precision = args[2] or 0
return p._precision_format(value_string, precision)
end
function p._precision_format(value_string, precision)
-- For access to Mediawiki built-in formatter.
local lang = mw.getContentLanguage();
local value
value, value_string = p._cleanNumber(value_string)
precision = p._cleanNumber(precision)
-- Check for non-numeric input
if value == nil or precision == nil then
return err('invalid input when rounding')
end
local current_precision = p._precision(value)
local order = p._order(value)
-- Due to round-off effects it is neccesary to limit the returned precision under
-- some circumstances because the terminal digits will be inaccurately reported.
if order + precision >= 14 then
if order + p._precision(value_string) >= 14 then
precision = 13 - order;
end
end
-- If rounding off, truncate extra digits
if precision < current_precision then
value = p._round(value, precision)
current_precision = p._precision(value)
end
local formatted_num = lang:formatNum(math.abs(value))
local sign
-- Use proper unary minus sign rather than ASCII default
if value < 0 then
sign = 'โ'
else
sign = ''
end
-- Handle cases requiring scientific notation
if string.find(formatted_num, 'E', 1, true) ~= nil or math.abs(order) >= 9 then
value = value * math.pow(10, -order)
current_precision = current_precision + order
precision = precision + order
formatted_num = lang:formatNum(math.abs(value))
else
order = 0;
end
formatted_num = sign .. formatted_num
-- Pad with zeros, if needed
if current_precision < precision then
local padding
if current_precision <= 0 then
if precision > 0 then
local zero_sep = lang:formatNum(1.1)
formatted_num = formatted_num .. zero_sep:sub(2,2)
padding = precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
else
padding = precision - current_precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
end
-- Add exponential notation, if necessary.
if order ~= 0 then
-- Use proper unary minus sign rather than ASCII default
if order < 0 then
order = 'โ' .. lang:formatNum(math.abs(order))
else
order = lang:formatNum(order)
end
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">ร</span>10<sup>' .. order .. '</sup>'
end
return formatted_num
end
--[[
divide
Implements the division operator
Usage:
{{#invoke:Math | divide | x | y | round= | precision= }}
--]]
function wrap.divide(args)
local x = args[1]
local y = args[2]
local round = args.round
local precision = args.precision
if not yesno then
yesno = require('Module:Yesno')
end
return p._divide(x, y, yesno(round), precision)
end
function p._divide(x, y, round, precision)
if y == nil or y == "" then
return err("Empty divisor")
elseif not tonumber(y) then
if type(y) == 'string' and string.sub(y, 1, 1) == '<' then
return y
else
return err("Not a number: " .. y)
end
elseif x == nil or x == "" then
return err("Empty dividend")
elseif not tonumber(x) then
if type(x) == 'string' and string.sub(x, 1, 1) == '<' then
return x
else
return err("Not a number: " .. x)
end
else
local z = x / y
if round then
return p._round(z, 0)
elseif precision then
return p._round(z, precision)
else
return z
end
end
end
--[[
Helper function that interprets the input numerically. If the
input does not appear to be a number, attempts evaluating it as
a parser functions expression.
]]
function p._cleanNumber(number_string)
if type(number_string) == 'number' then
-- We were passed a number, so we don't need to do any processing.
return number_string, tostring(number_string)
elseif type(number_string) ~= 'string' or not number_string:find('%S') then
-- We were passed a non-string or a blank string, so exit.
return nil, nil;
end
-- Attempt basic conversion
local number = tonumber(number_string)
-- If failed, attempt to evaluate input as an expression
if number == nil then
local success, result = pcall(mw.ext.ParserFunctions.expr, number_string)
if success then
number = tonumber(result)
number_string = tostring(number)
else
number = nil
number_string = nil
end
else
number_string = number_string:match("^%s*(.-)%s*$") -- String is valid but may contain padding, clean it.
number_string = number_string:match("^%+(.*)$") or number_string -- Trim any leading + signs.
if number_string:find('^%-?0[xX]') then
-- Number is using 0xnnn notation to indicate base 16; use the number that Lua detected instead.
number_string = tostring(number)
end
end
return number, number_string
end
--[[
Wrapper function that does basic argument processing. This ensures that all functions from #invoke can use either the current
frame or the parent frame, and it also trims whitespace for all arguments and removes blank arguments.
]]
local mt = { __index = function(t, k)
return function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return wrap[k](getArgs(frame)) -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.
end
end }
return setmetatable(p, mt)
2bbe734d898299f65412963a3c1782e9fcc4d9ca
Module:Location map
828
95
196
195
2023-11-27T15:13:33Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
require('strict')
local p = {}
local getArgs = require('Module:Arguments').getArgs
local function round(n, decimals)
local pow = 10^(decimals or 0)
return math.floor(n * pow + 0.5) / pow
end
function p.getMapParams(map, frame)
if not map then
error('The name of the location map definition to use must be specified', 2)
end
local moduletitle = mw.title.new('Module:Location map/data/' .. map)
if not moduletitle then
error(string.format('%q is not a valid name for a location map definition', map), 2)
elseif moduletitle.exists then
local mapData = mw.loadData('Module:Location map/data/' .. map)
return function(name, params)
if name == nil then
return 'Module:Location map/data/' .. map
elseif mapData[name] == nil then
return ''
elseif params then
return mw.message.newRawMessage(tostring(mapData[name]), unpack(params)):plain()
else
return mapData[name]
end
end
else
error('Unable to find the specified location map definition: "Module:Location map/data/' .. map .. '" does not exist', 2)
end
end
function p.data(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local params = {}
for k,v in ipairs(args) do
if k > 2 then
params[k-2] = v
end
end
return map(args[2], #params ~= 0 and params)
end
local hemisphereMultipliers = {
longitude = { W = -1, w = -1, E = 1, e = 1 },
latitude = { S = -1, s = -1, N = 1, n = 1 }
}
local function decdeg(degrees, minutes, seconds, hemisphere, decimal, direction)
if decimal then
if degrees then
error('Decimal and DMS degrees cannot both be provided for ' .. direction, 2)
elseif minutes then
error('Minutes can only be provided with DMS degrees for ' .. direction, 2)
elseif seconds then
error('Seconds can only be provided with DMS degrees for ' .. direction, 2)
elseif hemisphere then
error('A hemisphere can only be provided with DMS degrees for ' .. direction, 2)
end
local retval = tonumber(decimal)
if retval then
return retval
end
error('The value "' .. decimal .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not minutes then
error('Seconds were provided for ' .. direction .. ' without minutes also being provided', 2)
elseif not degrees then
if minutes then
error('Minutes were provided for ' .. direction .. ' without degrees also being provided', 2)
elseif hemisphere then
error('A hemisphere was provided for ' .. direction .. ' without degrees also being provided', 2)
end
return nil
end
decimal = tonumber(degrees)
if not decimal then
error('The degree value "' .. degrees .. '" provided for ' .. direction .. ' is not valid', 2)
elseif minutes and not tonumber(minutes) then
error('The minute value "' .. minutes .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not tonumber(seconds) then
error('The second value "' .. seconds .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal + (minutes or 0)/60 + (seconds or 0)/3600
if hemisphere then
local multiplier = hemisphereMultipliers[direction][hemisphere]
if not multiplier then
error('The hemisphere "' .. hemisphere .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal * multiplier
end
return decimal
end
-- Finds a parameter in a transclusion of {{Coord}}.
local function coord2text(para,coord) -- this should be changed for languages which do not use Arabic numerals or the degree sign
local lat, long = mw.ustring.match(coord,'<span class="p%-latitude latitude">([^<]+)</span><span class="p%-longitude longitude">([^<]+)</span>')
if lat then
return tonumber(para == 'longitude' and long or lat)
end
local result = mw.text.split(mw.ustring.match(coord,'%-?[%.%d]+ยฐ[NS] %-?[%.%d]+ยฐ[EW]') or '', '[ ยฐ]')
if para == 'longitude' then result = {result[3], result[4]} end
if not tonumber(result[1]) or not result[2] then
mw.log('Malformed coordinates value')
mw.logObject(para, 'para')
mw.logObject(coord, 'coord')
return error('Malformed coordinates value', 2)
end
return tonumber(result[1]) * hemisphereMultipliers[para][result[2]]
end
-- effectively make removeBlanks false for caption and maplink, and true for everything else
-- if useWikidata is present but blank, convert it to false instead of nil
-- p.top, p.bottom, and their callers need to use this
function p.valueFunc(key, value)
if value then
value = mw.text.trim(value)
end
if value ~= '' or key == 'caption' or key == 'maplink' then
return value
elseif key == 'useWikidata' then
return false
end
end
local function getContainerImage(args, map)
if args.AlternativeMap then
return args.AlternativeMap
elseif args.relief then
local digits = mw.ustring.match(args.relief,'^[1-9][0-9]?$') or '1' -- image1 to image99
if map('image' .. digits) ~= '' then
return map('image' .. digits)
end
end
return map('image')
end
function p.top(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local width
local default_as_number = tonumber(mw.ustring.match(tostring(args.default_width),"%d*"))
if not args.width then
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
elseif mw.ustring.sub(args.width, -2) == 'px' then
width = mw.ustring.sub(args.width, 1, -3)
else
width = args.width
end
local width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
if width_as_number == 0 then
-- check to see if width is junk. If it is, then use default calculation
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
end
if args.max_width ~= "" and args.max_width ~= nil then
-- check to see if width bigger than max_width
local max_as_number = tonumber(mw.ustring.match(args.max_width,"%d*")) or 0;
if width_as_number>max_as_number and max_as_number>0 then
width = args.max_width;
end
end
local retval = frame:extensionTag{name = 'templatestyles', args = {src = 'Module:Location map/styles.css'}}
if args.float == 'center' then
retval = retval .. '<div class="center">'
end
if args.caption and args.caption ~= '' and args.border ~= 'infobox' then
retval = retval .. '<div class="locmap noviewer noresize thumb '
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'tleft'
elseif args.float == '"center"' or args.float == 'center' or args.float == '"none"' or args.float == 'none' then
retval = retval .. 'tnone'
else
retval = retval .. 'tright'
end
retval = retval .. '"><div class="thumbinner" style="width:' .. (width + 2) .. 'px'
if args.border == 'none' then
retval = retval .. ';border:none'
elseif args.border then
retval = retval .. ';border-color:' .. args.border
end
retval = retval .. '"><div style="position:relative;width:' .. width .. 'px' .. (args.border ~= 'none' and ';border:1px solid lightgray">' or '">')
else
retval = retval .. '<div class="locmap" style="width:' .. width .. 'px;'
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'float:left;clear:left'
elseif args.float == '"center"' or args.float == 'center' then
retval = retval .. 'float:none;clear:both;margin-left:auto;margin-right:auto'
elseif args.float == '"none"' or args.float == 'none' then
retval = retval .. 'float:none;clear:none'
else
retval = retval .. 'float:right;clear:right'
end
retval = retval .. '"><div style="width:' .. width .. 'px;padding:0"><div style="position:relative;width:' .. width .. 'px">'
end
local image = getContainerImage(args, map)
local currentTitle = mw.title.getCurrentTitle()
retval = string.format(
'%s[[File:%s|%spx|%s%s|class=notpageimage]]',
retval,
image,
width,
args.alt or ((args.label or currentTitle.text) .. ' is located in ' .. map('name')),
args.maplink and ('|link=' .. args.maplink) or ''
)
if args.caption and args.caption ~= '' then
if (currentTitle.namespace == 0) and mw.ustring.find(args.caption, '##') then
retval = retval .. '[[Category:Pages using location map with a double number sign in the caption]]'
end
end
if args.overlay_image then
return retval .. '<div style="position:absolute;top:0;left:0">[[File:' .. args.overlay_image .. '|' .. width .. 'px|class=notpageimage]]</div>'
else
return retval
end
end
function p.bottom(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local retval = '</div>'
local currentTitle = mw.title.getCurrentTitle()
if not args.caption or args.border == 'infobox' then
if args.border then
retval = retval .. '<div style="padding-top:0.2em">'
else
retval = retval .. '<div style="font-size:91%;padding-top:3px">'
end
retval = retval
.. (args.caption or (args.label or currentTitle.text) .. ' (' .. map('name') .. ')')
.. '</div>'
elseif args.caption ~= '' then
-- This is not the pipe trick. We're creating a link with no text on purpose, so that CSS can give us a nice image
retval = retval .. '<div class="thumbcaption"><div class="magnify">[[:File:' .. getContainerImage(args, map) .. '|class=notpageimage| ]]</div>' .. args.caption .. '</div>'
end
if args.switcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">' .. args.switcherLabel .. '</span>'
elseif args.autoSwitcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">Show map of ' .. map('name') .. '</span>'
end
retval = retval .. '</div></div>'
if args.caption_undefined then
mw.log('Removed parameter caption_undefined used.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with removed parameters|caption_undefined]]'
end
end
if map('skew') ~= '' or map('lat_skew') ~= '' or map('crosses180') ~= '' or map('type') ~= '' then
mw.log('Removed parameter used in map definition ' .. map())
if currentTitle.namespace == 0 then
local key = (map('skew') ~= '' and 'skew' or '') ..
(map('lat_skew') ~= '' and 'lat_skew' or '') ..
(map('crosses180') ~= '' and 'crosses180' or '') ..
(map('type') ~= '' and 'type' or '')
retval = retval .. '[[Category:Location maps with removed parameters|' .. key .. ' ]]'
end
end
if string.find(map('name'), '|', 1, true) then
mw.log('Pipe used in name of map definition ' .. map())
if currentTitle.namespace == 0 then
retval = retval .. '[[Category:Location maps with a name containing a pipe]]'
end
end
if args.float == 'center' then
retval = retval .. '</div>'
end
return retval
end
local function markOuterDiv(x, y, imageDiv, labelDiv)
return mw.html.create('div')
:addClass('od')
:cssText('top:' .. round(y, 3) .. '%;left:' .. round(x, 3) .. '%')
:node(imageDiv)
:node(labelDiv)
end
local function markImageDiv(mark, marksize, label, link, alt, title)
local builder = mw.html.create('div')
:addClass('id')
:cssText('left:-' .. round(marksize / 2) .. 'px;top:-' .. round(marksize / 2) .. 'px')
:attr('title', title)
if marksize ~= 0 then
builder:wikitext(string.format(
'[[File:%s|%dx%dpx|%s|link=%s%s|class=notpageimage]]',
mark,
marksize,
marksize,
label,
link,
alt and ('|alt=' .. alt) or ''
))
end
return builder
end
local function markLabelDiv(label, label_size, label_width, position, background, x, marksize)
if tonumber(label_size) == 0 then
return mw.html.create('div'):addClass('l0'):wikitext(label)
end
local builder = mw.html.create('div')
:cssText('font-size:' .. label_size .. '%;width:' .. label_width .. 'em')
local distance = round(marksize / 2 + 1)
if position == 'top' then -- specified top
builder:addClass('pv'):cssText('bottom:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em')
elseif position == 'bottom' then -- specified bottom
builder:addClass('pv'):cssText('top:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em')
elseif position == 'left' or (tonumber(x) > 70 and position ~= 'right') then -- specified left or autodetected to left
builder:addClass('pl'):cssText('right:' .. distance .. 'px')
else -- specified right or autodetected to right
builder:addClass('pr'):cssText('left:' .. distance .. 'px')
end
builder = builder:tag('div')
:wikitext(label)
if background then
builder:cssText('background-color:' .. background)
end
return builder:done()
end
local function getX(longitude, left, right)
local width = (right - left) % 360
if width == 0 then
width = 360
end
local distanceFromLeft = (longitude - left) % 360
-- the distance needed past the map to the right equals distanceFromLeft - width. the distance needed past the map to the left equals 360 - distanceFromLeft. to minimize page stretching, go whichever way is shorter
if distanceFromLeft - width / 2 >= 180 then
distanceFromLeft = distanceFromLeft - 360
end
return 100 * distanceFromLeft / width
end
local function getY(latitude, top, bottom)
return 100 * (top - latitude) / (top - bottom)
end
function p.mark(frame, args, map)
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map~'})
end
local mapnames = {}
if not map then
if args[1] then
map = {}
for mapname in mw.text.gsplit(args[1], '#', true) do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
mapnames[#mapnames + 1] = mapname
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
args[1] = 'World'
end
end
if type(map) == 'table' then
local outputs = {}
local oldargs = args[1]
for k,v in ipairs(map) do
args[1] = mapnames[k]
outputs[k] = tostring(p.mark(frame, args, v))
end
args[1] = oldargs
return table.concat(outputs, '#PlaceList#') .. '#PlaceList#'
end
local x, y, longitude, latitude
longitude = decdeg(args.lon_deg, args.lon_min, args.lon_sec, args.lon_dir, args.long, 'longitude')
latitude = decdeg(args.lat_deg, args.lat_min, args.lat_sec, args.lat_dir, args.lat, 'latitude')
if args.excludefrom then
-- If this mark is to be excluded from certain maps entirely (useful in the context of multiple maps)
for exclusionmap in mw.text.gsplit(args.excludefrom, '#', true) do
-- Check if this map is excluded. If so, return an empty string.
if args[1] == exclusionmap then
return ''
end
end
end
local builder = mw.html.create()
local currentTitle = mw.title.getCurrentTitle()
if args.coordinates then
-- Temporarily removed to facilitate infobox conversion. See [[Wikipedia:Coordinates in infoboxes]]
-- if longitude or latitude then
-- error('Coordinates from [[Module:Coordinates]] and individual coordinates cannot both be provided')
-- end
longitude = coord2text('longitude', args.coordinates)
latitude = coord2text('latitude', args.coordinates)
elseif not longitude and not latitude and args.useWikidata then
-- If they didn't provide either coordinate, try Wikidata. If they provided one but not the other, don't.
local entity = mw.wikibase.getEntity()
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1].mainsnak.snaktype == 'value' then
local value = entity.claims.P625[1].mainsnak.datavalue.value
longitude, latitude = value.longitude, value.latitude
end
if args.link and (currentTitle.namespace == 0) then
builder:wikitext('[[Category:Location maps with linked markers with coordinates from Wikidata]]')
end
end
if not longitude then
error('No value was provided for longitude')
elseif not latitude then
error('No value was provided for latitude')
end
if currentTitle.namespace > 0 then
if (not args.lon_deg) ~= (not args.lat_deg) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Degrees]]')
elseif (not args.lon_min) ~= (not args.lat_min) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Minutes]]')
elseif (not args.lon_sec) ~= (not args.lat_sec) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Seconds]]')
elseif (not args.lon_dir) ~= (not args.lat_dir) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Hemisphere]]')
elseif (not args.long) ~= (not args.lat) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Decimal]]')
end
end
if ((tonumber(args.lat_deg) or 0) < 0) and ((tonumber(args.lat_min) or 0) ~= 0 or (tonumber(args.lat_sec) or 0) ~= 0 or (args.lat_dir and args.lat_dir ~='')) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if ((tonumber(args.lon_deg) or 0) < 0) and ((tonumber(args.lon_min) or 0) ~= 0 or (tonumber(args.lon_sec) or 0) ~= 0 or (args.lon_dir and args.lon_dir ~= '')) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if (((tonumber(args.lat_min) or 0) < 0) or ((tonumber(args.lat_sec) or 0) < 0)) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if (((tonumber(args.lon_min) or 0) < 0) or ((tonumber(args.lon_sec) or 0) < 0)) then
builder:wikitext('[[Category:Location maps with negative degrees and minutes or seconds]]')
end
if args.skew or args.lon_shift or args.markhigh then
mw.log('Removed parameter used in invocation.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
local key = (args.skew and 'skew' or '') ..
(args.lon_shift and 'lon_shift' or '') ..
(args.markhigh and 'markhigh' or '')
builder:wikitext('[[Category:Location maps with removed parameters|' .. key ..' ]]')
end
end
if map('x') ~= '' then
x = tonumber(mw.ext.ParserFunctions.expr(map('x', { latitude, longitude })))
else
x = tonumber(getX(longitude, map('left'), map('right')))
end
if map('y') ~= '' then
y = tonumber(mw.ext.ParserFunctions.expr(map('y', { latitude, longitude })))
else
y = tonumber(getY(latitude, map('top'), map('bottom')))
end
if (x < 0 or x > 100 or y < 0 or y > 100) and not args.outside then
mw.log('Mark placed outside map boundaries without outside flag set. x = ' .. x .. ', y = ' .. y)
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
local key = currentTitle.prefixedText
builder:wikitext('[[Category:Location maps with marks outside map and outside parameter not set|' .. key .. ' ]]')
end
end
local mark = args.mark or map('mark')
if mark == '' then
mark = 'Red pog.svg'
end
local marksize = tonumber(args.marksize) or tonumber(map('marksize')) or 8
local imageDiv = markImageDiv(mark, marksize, args.label or mw.title.getCurrentTitle().text, args.link or '', args.alt, args[2])
local labelDiv
if args.label and args.position ~= 'none' then
labelDiv = markLabelDiv(args.label, args.label_size or 91, args.label_width or 6, args.position, args.background, x, marksize)
end
return builder:node(markOuterDiv(x, y, imageDiv, labelDiv))
end
local function switcherSeparate(s)
if s == nil then return {} end
local retval = {}
for i in string.gmatch(s .. '#', '([^#]*)#') do
i = mw.text.trim(i)
retval[#retval + 1] = (i ~= '' and i)
end
return retval
end
function p.main(frame, args, map)
local caption_list = {}
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map', valueFunc = p.valueFunc})
end
if args.useWikidata == nil then
args.useWikidata = true
end
if not map then
if args[1] then
map = {}
for mapname in string.gmatch(args[1], '[^#]+') do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
end
if args['caption'] then
if args['caption'] == "" then
while #caption_list < #map do
caption_list[#caption_list + 1] = args['caption']
end
else
for caption in mw.text.gsplit(args['caption'], '##', true) do
caption_list[#caption_list + 1] = caption
end
end
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
end
end
if type(map) == 'table' then
local altmaps = switcherSeparate(args.AlternativeMap)
if #altmaps > #map then
error(string.format('%d AlternativeMaps were provided, but only %d maps were provided', #altmaps, #map))
end
local overlays = switcherSeparate(args.overlay_image)
if #overlays > #map then
error(string.format('%d overlay_images were provided, but only %d maps were provided', #overlays, #map))
end
if #caption_list > #map then
error(string.format('%d captions were provided, but only %d maps were provided', #caption_list, #map))
end
local outputs = {}
args.autoSwitcherLabel = true
for k,v in ipairs(map) do
args.AlternativeMap = altmaps[k]
args.overlay_image = overlays[k]
args.caption = caption_list[k]
outputs[k] = p.main(frame, args, v)
end
return '<div class="switcher-container">' .. table.concat(outputs) .. '</div>'
else
return p.top(frame, args, map) .. tostring( p.mark(frame, args, map) ) .. p.bottom(frame, args, map)
end
end
return p
e4ccfcc6e71c45a4355aa7240a0a8b81dc19f8eb
Template:Parameter names example
10
96
198
197
2023-11-27T15:13:33Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{documentation}}<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
256a11b9ae7ac7e492b3d9de86ade1ffa96bffd1
Template:Infobox military operation
10
97
200
199
2023-11-27T15:13:34Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{infobox
|bodyclass = vevent
|bodystyle = {{WPMILHIST Infobox style|main_box_raw}}
|abovestyle = {{WPMILHIST Infobox style|header_raw}}
|aboveclass = summary
| headerstyle = {{WPMILHIST Infobox style|header_raw}}
|above = {{if empty|{{{title|}}}|{{{name|}}}|{{PAGENAMEBASE}}}}
|subheaderstyle = {{WPMILHIST Infobox style|sub_header_raw}}
|subheader = {{br separated entries|{{{subtitle|}}}|{{#if:{{{partof|}}}{{{conflict|}}}|Part of {{if empty|{{{conflict|}}}|{{{partof|}}}}} }}}}
|labelstyle = padding-right: 1em;
|imagestyle = {{WPMILHIST Infobox style|image_box_raw}}
|image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|}}}|upright={{{image_upright|1}}}|alt={{{alt|}}}}}
|caption = {{{caption|}}}
| label1 = {{#if:{{{scope|}}}|Operational scope|Type}}
| data1 = {{if empty|{{{scope|}}}|{{{type|}}}}}
| label2 = Location{{#if:{{{location2|}}}|s}}
| data2 = {{br separated entries
|1 = {{#if:{{{location|{{{place|}}}}}}|<div style="display:inline;" class="location">{{{location|{{{place|}}}}}}</div>}}
|2 = {{{coordinates|}}}
|3 = {{#if:{{{location2|}}}|<div style="display:inline;" class="location">{{{location2|}}}</div>}}
|4 = {{#if:{{{location2|}}}|{{{coordinates2|}}}}}
|5 = {{#if:{{{location3|}}}|<div style="display:inline;" class="location">{{{location3|}}}</div>}}
|6 = {{#if:{{{location3|}}}|{{{coordinates3|}}}}}
|7 = {{#if:{{{location4|}}}|<div style="display:inline;" class="location">{{{location4|}}}</div>}}
|8 = {{#if:{{{location4|}}}|{{{coordinates4|}}}}}
|9 = {{#if:{{{location5|}}}|<div style="display:inline;" class="location">{{{location5|}}}</div>}}
|10= {{#if:{{{location5|}}}|{{{coordinates5|}}}}}
|11= {{#if:{{{location6|}}}|<div style="display:inline;" class="location">{{{location6|}}}</div>}}
|12= {{#if:{{{location6|}}}|{{{coordinates6|}}}}}
|13= {{#if:{{{location7|}}}|<div style="display:inline;" class="location">{{{location7|}}}</div>}}
|14= {{#if:{{{location7|}}}|{{{coordinates7|}}}}}
|15= {{#if:{{{location8|}}}|<div style="display:inline;" class="location">{{{location8|}}}</div>}}
|16= {{#if:{{{location8|}}}|{{{coordinates8|}}}}}
|17= {{#if:{{{location9|}}}|<div style="display:inline;" class="location">{{{location9|}}}</div>}}
|18= {{#if:{{{location9|}}}|{{{coordinates9|}}}}}
|19= {{#if:{{{location10|}}}|<div style="display:inline;" class="location">{{{location10|}}}</div>}}
|20= {{#if:{{{location10|}}}|{{{coordinates10|}}}}}
}}
| label3 = Planned
| data3 = {{{planned|}}}
| label4 = Planned by
| data4 = {{{planned_by|}}}
| label5 = Commanded by
| data5 = {{{commanded_by|}}}
| label6 = {{#if:{{{target|}}}|Target|Objective}}
| data6 = {{if empty|{{{target|}}}|{{{objective|}}}}}
| label7 = Date
| data7 = {{br separated entries
|1 = {{if empty|{{{executed|}}}|{{{date|}}}}}
|2 = {{{time|}}}
|3 = {{#if:{{{time-begin|}}}|{{{time-begin}}} – {{{time-end|}}}}}
}} {{#if:{{{timezone|}}}|({{{timezone}}})}}
| label8 = Executed by
| data8 = {{if empty|{{{instigator|}}}|{{{executed_by|}}}}}
| label9 = Outcome
| data9 = {{{outcome|}}}
| label10 = Casualties
| data10 = {{if empty|{{{casualties|}}}|{{br separated entries
|1 = {{#if:{{{fatalities|}}}|{{{fatalities|}}} killed}}
|2 = {{#if:{{{injuries|}}}|{{{injuries|}}} injured}}
}} }}
| header27 = {{#if:{{{map_type|}}}|<nowiki />}}
| data28 = {{#if:{{{map_type|}}}|
{{#if:{{{coordinates2|}}}|
{{Location map many|{{{map_type}}}|coordinates1={{if empty|{{{map_coord|}}} | {{{coordinates|}}} }}|width={{{map_size|220}}}|float=center|border=infobox|label1={{{map_label|}}}|caption={{{map_caption|Location within {{#invoke:Location map|data|{{{map_type}}}|name}} }}}
|coordinates2={{{coordinates2|}}}|label2={{{map_label2|}}}
{{#if:{{{coordinates3|}}}|{{!}}coordinates3={{{coordinates3|}}}{{!}}label3={{{map_label3|}}} }}
{{#if:{{{coordinates4|}}}|{{!}}coordinates4={{{coordinates4|}}}{{!}}label4={{{map_label4|}}} }}
{{#if:{{{coordinates5|}}}|{{!}}coordinates5={{{coordinates5|}}}{{!}}label5={{{map_label5|}}} }}
{{#if:{{{coordinates6|}}}|{{!}}coordinates6={{{coordinates6|}}}{{!}}label6={{{map_label6|}}} }}
{{#if:{{{coordinates7|}}}|{{!}}coordinates7={{{coordinates7|}}}{{!}}label7={{{map_label7|}}} }}
{{#if:{{{coordinates8|}}}|{{!}}coordinates8={{{coordinates8|}}}{{!}}label8={{{map_label8|}}} }}
{{#if:{{{coordinates9|}}}|{{!}}coordinates9={{{coordinates9|}}}{{!}}label9={{{map_label9|}}} }}
{{#if:{{{coordinates10|}}}|{{!}}coordinates10={{{coordinates10|}}}{{!}}label10={{{map_label10|}}} }}
}}
|{{Location map|{{{map_type}}}|coordinates={{if empty|{{{map_coord|}}} | {{{coordinates|}}} }}|width={{{map_size|220}}}|float=center|border=infobox|label={{{map_label|}}}|caption={{{map_caption|Location within {{#invoke:Location map|data|{{{map_type}}}|name}} }}} }}
}}
}}
}}{{{campaignbox|}}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox military operation with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox military operation]] with unknown parameter "_VALUE_"|ignoreblank=y| alt | campaignbox | caption | casualties | commanded_by | conflict | coordinates | date | executed | executed_by | fatalities | image | image_size | image_upright | injuries | instigator | location | map_caption | map_coord | map_label | map_size | map_type | name | objective | outcome | partof | planned | planned_by | scope | subtitle | target | time | time-begin | time-end | timezone | title | type | coordinates2 | coordinates3 | coordinates4 | coordinates5 | coordinates6 | coordinates7 | coordinates8 | coordinates9 | coordinates10 | map_label2 | map_label3 | map_label4 | map_label5 | map_label6 | map_label7 | map_label8 | map_label9 | map_label10 | location2 | location3 | location4 | location5 | location6 | location7 | location8 | location9 | location10 }}<noinclude>
{{template doc}}
</noinclude>
829164a43ec689efc952b0722e2406cf1185cf66
Template:Start date
10
98
202
201
2023-11-27T15:13:35Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#if: {{{4|}}}
|{{#if: {{{5|}}}
|{{padleft:{{{4}}}|2|0}}:{{padleft:{{{5}}}|2|0}}{{#if: {{{6|}}}
|:{{padleft:{{{6}}}|2|0}} }}, }} }}<!--ABOVE FOR TIME; BELOW FOR DATE
-->{{#if: {{{1|}}}
|{{#if: {{{2|}}}
|{{#if: {{{3|}}}
|{{#if: {{{df|}}}|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}}|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}},}} {{{1}}}|{{MONTHNAME|{{{2}}}}} {{{1}}}}}|{{{1}}}}}}}{{#if: {{{7|}}}
| ({{#ifeq: {{{7}}}|Z|UTC|{{{7}}}}})}}<!-- BELOW FOR hCalendar
--><span style="display:none"> (<span class="bday dtstart published updated">{{#if: {{{1|}}}
| {{{1}}}{{#if: {{{2|}}}
| -{{padleft:{{{2}}}|2|0}}{{#if: {{{3|}}}
| -{{padleft:{{{3}}}|2|0}} }} }}<!--
-->{{#if: {{{4|}}}
| T{{padleft:{{{4}}}|2|0}}{{#if: {{{5|}}}
| :{{padleft:{{{5}}}|2|0}}{{#if: {{{6|}}}
| :{{padleft:{{{6}}}|2|0}} }} }} }} }}{{{7|}}}</span>)</span></includeonly><noinclude>
{{documentation}}
</noinclude>
2bdc464c20f7d568f3d482c9fb2d04f5d266f982
Template:MONTHNAME
10
99
204
203
2023-11-27T15:13:35Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}|{{#switch:{{MONTHNUMBER|{{{1}}}}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=''month''!}}|Missing required parameter 1=''month''!}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
25327282f70efd1189b70245a0e23509f3bb65e6
Template:MONTHNUMBER
10
100
206
205
2023-11-27T15:13:35Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}
|{{#switch:{{lc:{{{1}}}}}
|january|jan=1
|february|feb=2
|march|mar=3
|apr|april=4
|may=5
|june|jun=6
|july|jul=7
|august|aug=8
|september|sep|sept=9
|october|oct=10
|november|nov=11
|december|dec=12
|{{#ifexpr:{{{1}}}<0
|{{#ifexpr:(({{{1}}})round 0)!=({{{1}}})
|{{#expr:12-(((0.5-({{{1}}}))round 0)mod 12)}}
|{{#expr:12-(((11.5-({{{1}}}))round 0)mod 12)}}
}}
|{{#expr:(((10.5+{{{1}}})round 0)mod 12)+1}}
}}
}}
|Missing required parameter 1=''month''!
}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
c2ade663b96231e493986cd17b454923da290098
Template:UF-hcal
10
101
208
207
2023-11-27T15:13:36Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{Microformat message
| format = hCalendar
| data = event details
| subtemplates =
{{#if:{{{hide_subtemplates}}} |<noinclude>}}
Dates will only be included if you use {{tl|start date}} (for single dates) or {{tl|end date}}. Do not, however, use these templates [[Wikipedia:WikiProject Microformats/dates|if a date before 1583 CE is involved]].
To include URLs, use {{tl|URL}}.
{{#if:{{{hide_subtemplates}}} |</noinclude>}}
|attendee |contact |description |dtend |dtstart |location |organiser |summary |url |vevent
| nocollapse = on
}}<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCalendars|{{PAGENAME}}]]}} }}</includeonly><noinclude>
{{Documentation |content={{Microformat message templates}}}}
[[Category:Microformat (uF) message templates]]
</noinclude>
f453b47f676a5c474e14155f7013b69b4716748b
Module:Parameter names example
828
102
210
209
2023-11-27T15:13:36Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
--targs['nocat'] = 'yes';
--targs['categories'] = 'no';
--targs['demo'] = 'yes';
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
fdf94fb7a5dc1fabf118d60488a02f1e65b0df24
Module:Location map/data/Earth
828
103
212
211
2023-11-27T15:13:37Z
WikiA3ro
2
1 revision imported
Scribunto
text/plain
return {
name = 'Earth',
top = 90,
bottom = -90,
left = -180,
right = 180,
image = 'World location map (equirectangular 180).svg',
image1='World location map (equirectangular 180).svg'}
0c7a9c4349065ea43134d0a61037d31862f2a042
Template:Flatlist
10
104
214
213
2023-11-27T15:13:37Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
<templatestyles src="Hlist/styles.css"/><div class="hlist {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
{{{1}}}
</div>}}<noinclude></div>
{{documentation}}
</noinclude>
cf60aa4aef920d48fa394e786f72fe5f6dcd3169
Template:Infobox military operation/doc
10
105
216
215
2023-11-27T15:13:39Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{#ifeq:{{{noheader|}}}|yes||{{Documentation subpage}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
}}
This infobox may be used to describe a particular planned or executed military operation or attack. For operations that resulted in combat, it can be used as an auxiliary template to the {{tl|infobox military conflict}}, if necessary; for other types of operations, including those that were planned but never executed, it may be used alone. In the case of conflicts that consisted of multiple independent operations, multiple copies of the box may be used on a single article.
__TOC__
=== Usage ===
{{Parameter names example|_template = Infobox military operation |title |name |partof |conflict |image |image_size |image_upright |alt |caption |coordinates = {{coord|0|0}} |map_type=Earth |map_size= |map_label |map_caption |scope |type |location |coordinates |planned |planned_by |commanded_by |target |objective |date |time |time-begin |time-end |timezone |executed_by |outcome |casualties |fatalities |injuries}}
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Infobox military operation
|name =
|partof =
|subtitle =
|image =
|image_upright =
|alt =
|caption =
|scope =
|type =
|location =
|location2 = <!-- 2 through 10 for more locations -->
|coordinates =
|coordinates2 = <!-- 2 through 10 for more locations -->
|map_type =
|map_size =
|map_caption =
|map_label =
|map_label2 = <!-- 2 through 10 for more locations -->
|planned =
|planned_by =
|commanded_by =
|objective =
|target =
|date = <!-- {{start date|YYYY|MM|DD|df=y}} -->
|time =
|time-begin =
|time-end =
|timezone =
|executed_by =
|outcome =
|casualties =
|fatalities =
|injuries =
}}</syntaxhighlight>
=== Example ===
{{Infobox military operation
|name = Case Blue
|scope = Strategic offensive
|planned_by = ''[[Wehrmacht]]''
|objective = Capture of [[Caucasus]] oil fields
|executed = Began {{start date|1942|06|28|df=y}}
|executed_by = [[Army Group South]]
}}
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Infobox military operation
|name = Case Blue
|scope = Strategic offensive
|planned_by = ''[[Wehrmacht]]''
|objective = Capture of [[Caucasus]] oil fields
|executed = Began {{start date|1942|06|28|df=y}}
|executed_by = [[Army Group South]]
}}</syntaxhighlight>
=== Parameters ===
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
* '''name''' โ the name of the operational plan; names in multiple languages may be provided.
* '''subtitle''' โ alternative name of the conflict being described.
* '''partof''' โ ''optional'' โ the larger conflict containing the event described in the article.
* '''image''' โ ''optional'' โ an image for the warbox. Given in the form <code>File:Example.jpg</code>
* '''image_upright''' โ ''optional'' โ image upright scaling factor.
* '''alt''' โ ''optional'' โ [[Wikipedia:Manual of Style/Accessibility/Alternative text for images|Alternative text for image]] that is accessible to [[screen reader]]s to help the [[visually impaired]]
* '''caption''' โ ''optional'' โ the text to be placed below the image.
* '''location''' โ ''optional'' โ the location of the operation.
* '''coordinates''' โ ''optional'' โ the coordinates for the location above, given as {{tl|coord}} with ''|display=inline,title''. Used to display the geographic location of the conflict and the location on a map added with the <code>map_type</code> parameter. If coordinates for several locations are given, consider if hany shall have the title display.
* '''map_type''' – ''optional'' – the base map to be used for the location map, e.g. "Scotland"; see {{tl|location map}} for more details.
* '''map_size''' – ''optional'' – width of the location map in pixels (px), e.g. "150"; defaults to: "220".
* '''map_caption''' – ''optional'' – caption displayed below the location map; defaults to "Location within {{{map_type}}}", e.g. "Location within Scotland".
* '''map_label''' – ''optional'' – the label placed next to the marker on the location map.
* '''scope''' โ ''optional'' โ the scope of the operation, such as "Strategic", "Operational", or "Tactical".
* '''type''' โ ''optional'' โ as an alternative to the '''scope''' field above, the type of operation, such as "Suicide attack" or "Ambush".
* '''planned''' โ ''optional'' โ the date(s) on which the plan was developed.
* '''planned_by''' โ ''optional'' โ the person or group responsible for developing the plan.
* '''commanded_by''' โ ''optional'' โ the person commanding the operation.
* '''objective''' โ ''optional'' โ the objective(s) of the operation.
* '''target''' โ ''optional'' โ as an alternative to the '''objective''' field above, the target(s) of the operation.
* '''date''' โ ''optional'' โ the date(s), if any, on which the operation was executed. use {{Tl|Start date}} (and {{Tl|End date}} if required)
* '''time''' โ ''optional'' โ the time, if any, at which the operation was executed.
* '''time-begin''' and '''time-end''' โ ''optional'' โ as an alternative to the '''time''' field above, the start and end times, respectively.
* '''timezone''' โ ''optional'' โ the timezone of the location of the operation; [[UTC]]+X, [[UTC]]-X, or [[UTC]] (i.e. offset from [[UTC]]) is preferred.
* '''executed_by''' โ ''optional'' โ the people, groups, units, or formations responsible for executing the operation.
* '''outcome''' โ ''optional'' โ the outcome of the operation from the perspective of the planners.
* '''casualties''' โ ''optional'' โ any casualties occurring during the execution of the operation.
* '''fatalities''' โ ''optional'' โ as an alternative to the '''casualties''' field above, the number of fatalities occurring during the execution of the operation.
* '''injuries''' โ ''optional'' โ as an alternative to the '''casualties''' field above, the number of injuries occurring during the execution of the operation.
=== Microformat ===
{{UF-hcal}}
=== TemplateData ===
{{collapse top|title=[[Wikipedia:TemplateData|TemplateData]] for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=y}}
<templatedata>
{
"description": "This infobox may be used to describe a particular planned or executed military operation or attack.",
"format": "{{_\n| _____________ = _\n}}\n",
"params": {
"name": {
"label": "Name",
"description": "The name of the military operation",
"type": "string",
"suggested": true
}
},
"paramOrder": [
"name"
]
}
</templatedata>
{{collapse bottom}}
=== See also ===
* {{tl|Infobox civil conflict}}
* {{tl|Infobox civilian attack}}
* {{tl|Infobox military conflict}}<noinclude>
[[Category:WikiProject Military history template instructions|Military operation]]
</noinclude>
<includeonly>
{{Sandbox other||{{#ifeq:{{{noheader|}}}|yes||
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:Templates with coordinates fields]]
[[Category:Military auxiliary infobox templates|Military operation]]
[[Category:Templates that add a tracking category|{{PAGENAME}}]]
}}}}</includeonly>
8e4979061f83f9af8d04b1f9f460ccb593e7d740
Template:Infobox military conflict/doc
10
106
218
217
2023-11-27T15:13:41Z
WikiA3ro
2
1 revision imported
wikitext
text/x-wiki
{{Documentation subpage}}
{{High-use|16,100}}
{{Lua|Module:Infobox military conflict}}
__TOC__
==Usage==
{{Infobox military conflict
| conflict = Battle of Lรผtzen
| partof = the [[Thirty Years' War]]
| image = Battle of Lutzen.jpg
| alt = Battle of Lutzen by Carl Whalbom depicting King Gustavus Aolphus falling from a horse mortally wounded in a melee
| image_size = 300px
| caption = The '' '''Battle of Lรผtzen''' '' by [[Carl Wahlbom]] shows the death of King [[Gustavus Adolphus]] on 16 November 1632.
| date = 6 November ([[Old Style and New Style dates|O.S.]]) or 16 November ([[Old Style and New Style dates|N.S.]]), 1632
| place = Near [[Lรผtzen]], southwest of [[Leipzig]]<br />(present-day [[Germany]])
| coordinates = {{coord|51|15|N|12|08|E|region:DE_type:city}}
| result = Protestant victory <br />(see {{blue|Aftermath}} section)
| combatant1 = {{flagicon|Sweden|1562}} [[Swedish Empire|Sweden]]<br />[[Protestant Union]]
| combatant2 = {{flag|Holy Roman Empire}}<br/>{{flagicon image|Catholic League (Germany).svg}} [[Catholic League (German)|Catholic League]]
| commander1 = {{flagicon|Sweden|1562}} [[Gustavus Adolphus]]{{KIA}}<br/>{{flagicon|Sweden|1562}} [[Dodo zu Innhausen und Knyphausen|Dodo von Knyphausen]]<br/>{{Flagicon|Electorate of Saxony}} [[Bernhard of Saxe-Weimar]]<br/>{{flagicon|Sweden|1562}} [[Robert Munro, 18th Baron of Foulis]]
| commander2 = {{flagicon|Holy Roman Empire}} [[Albrecht von Wallenstein]]<br/>{{flagicon|Holy Roman Empire}} [[Heinrich Holk]]<br/>{{flagicon|Holy Roman Empire}} [[Gottfried zu Pappenheim|Count Gottfried zu Pappenheim]]{{DOW}}
| strength1 = 12,800 infantry<br />6,200 cavalry<br />60 guns
| strength2 = 10,000 infantry<br />7,000 cavalry, plus 3,000 infantry and 2,000 cavalry on arrival<br />24 guns
| casualties1 = 3,400 dead and 1,600 wounded or missing
| casualties2 = Probably about the same as Swedish casualties{{fakeref|1}}
}}
A military conflict infobox (sometimes referred to as a warbox) may be used to summarize information about a particular military conflict (a battle, campaign, war, or group of related wars) in a standard manner.
Information summarized in an infobox should follow the general guidance for writing a [[Wikipedia:Manual of Style/Lead section|lead section]]. It should not "make claims" or present material not covered by the article. As with a lead section, there is some discretion in citing information in an infobox. The same guidance should be applied to an infobox as given for [[Wikipedia:Manual of Style/Lead section#Citations|citations in a lead section]]. Information in an infobox must conform with [[Wikipedia:Verifiability|verifiability]], [[Wikipedia:Neutral point of view|point-of-view]] and other policies.
Information in the infobox should not be "controversial". Refer the reader to an appropriate section in the article or leave the parameter blank rather than make an unsubstantiated or doubtful claim.
The infobox should be added using the {{tl|infobox military conflict}} template, as shown below:
<div style="width:250px;background:#dddddd;border: 1px solid black;padding:0.5em 1em 0.5em 1em"><syntaxhighlight lang="wikitext">
{{Infobox military conflict
| conflict =
| width =
| partof =
| image =
| image_size =
| alt =
| caption =
| date =
| place =
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result =
| status =
| combatants_header =
| combatant1 =
| combatant2 =
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 =
| strength2 =
| strength3 =
| casualties1 =
| casualties2 =
| casualties3 =
| notes =
| campaignbox =
}}
</syntaxhighlight></div>
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
===Parameters===
* '''conflict''' โ the name of the conflict being described (e.g. "Battle of Lรผtzen" or "World War I").
* '''width''' โ ''optional'' โ the width of the infobox, e.g. "400px"; defaults to: "315px".
* '''partof''' โ ''optional'' โ the larger conflict containing the event described in the article. For battles or campaigns, this should be the war during which the event takes place; for particularly large wars, this may include a theatre (e.g. "the Eastern Front of World War II"). For wars, the parameter may be used to link to a larger group of wars (e.g. the [[Italian War of 1521โ26]] to the [[Italian Wars]]). It may be necessary to insert "the" before the name of the war for proper grammar.
* '''image''' โ ''optional'' โ an image for the warbox. Given in the form <code>Example.jpg</code>
* '''image_size''' โ ''optional'' โ a size for the image
* '''alt''' โ ''optional'' โ [[Wikipedia:Manual of Style/Accessibility/Alternative text for images|Alternative text for image]] that is accessible to [[screen reader]]s to help the [[visually impaired]]
* '''caption''' โ ''optional'' โ the text to be placed below the image.
* '''date''' โ ''optional'' โ the date of the conflict described. Convention is to give the actual date for battles and the years for wars, but this does not always apply.
* '''place''' โ the location of the conflict. For conflicts covering a wide area, a general description (e.g. "France", or "Europe", or "Worldwide") may be used.
* '''coordinates''' – ''optional'' – the location of the structure, given as a coordinate pair by using {{tl|coord}} with ''display=inline,title''. Used to display the geographic location of the conflict and the location on a map added with the <code>map_type</code> parameter.
* '''map_type''' – ''optional'' – the base map to be used for the location map, e.g. "Scotland"; see {{tl|location map}} for more details.
* '''map_relief''' – ''optional'' – "yes" if the location map is a relief map; see {{tl|location map}} for more details.
* '''map_size''' – ''optional'' – width of the location map in pixels (px), e.g. "150"; defaults to: "220".
* '''map_mark''' – ''optional'' – the name of a file to use as the location map marker, e.g. Green_pog.svg; defaults to: "Red_pog.svg".
* '''map_marksize''' – ''optional'' – width of the location map marker in pixels (px), e.g. "10"; defaults to: "8".
* '''map_caption''' – ''optional'' – caption displayed below the location map; defaults to "Location within {{{map_type}}}", e.g. "Location within Scotland".
* '''map_label''' – ''optional'' – the label placed next to the marker on the location map.
* '''territory''' โ ''optional'' โ any changes in territorial control as a result of the conflict; this should not be used for overly lengthy descriptions of the peace settlement.
* '''action''' โ ''optional'' โ In case of Coup d'รtat, short description of ''modus operandi'', e.g. "...marched over the city...", "...dissolving the Congress of the Republic...", "...take the government hostage ...", "...put the country under military control ...", etc.
* '''result''' โ ''optional'' โ this parameter may use one of two standard terms: "X victory" or "Inconclusive". The term used is for the "immediate" outcome of the "subject" conflict and should reflect what the sources say. In cases where the standard terms do not accurately describe the outcome, a link or note should be made to the section of the article where the result is discussed in detail (such as "See the {{blue|Aftermath}} section"). Such a note can also be used in conjunction with the standard terms but should not be used to conceal an ambiguity in the "immediate" result. Do not introduce non-standard terms like "decisive", "marginal" or "tactical", or contradictory statements like "decisive tactical victory but strategic defeat". Omit this parameter altogether rather than engage in [[WP:NOR|speculation]] about which side won or by how much.
* '''status''' โ ''optional'' โ for ongoing conflicts, the current status of the conflict. This should not be used if a final result (above) is provided.
* '''combatants_header''' โ ''optional'' โ sets the header text for the combatants section. Default is "Belligerents". In case of Coup d'รtat, use "Government-Insurgents "
* '''combatant1'''/'''combatant2'''/'''combatant3''' โ ''optional'' โ the parties participating in the conflict. This is most commonly the countries whose forces took part in the conflict; however, larger groups (such as alliances or international organizations) or smaller ones (such as particular units, formations, or groups) may be indicated if doing so improves reader understanding. When there is a large number of participants, it may be better to list only the three or four major groups on each side of the conflict, and to describe the rest in the body of the article. The '''combatant3''' field may be used if a conflict has three distinct "sides", and should be left blank on other articles. Combatants should be listed in order of importance to the conflict, be it in terms of military contribution, political clout, or a recognized chain of command. If differing metrics can support alternative lists, then ordering is left to the editors of the particular article. The practice of writing in a "Supported by" subheading is deprecated (see [[Template talk:Infobox military conflict#RfC on "supported by" being used with the belligerent parameter|discussion]]).
** '''combatant1a'''/'''combatant2a'''/'''combatant3a''' โ ''optional'' โ in cases where the parties significantly changed over the course of the conflict, these subsidiary fields may be used to provide additional rows for the '''combatant''N''''' fields (above).
** '''combatant1b'''/'''combatant2b'''/'''combatant3b''' โ ''optional'' โ additional row, as above.
** '''combatant1c'''/'''combatant2c'''/'''combatant3c''' โ ''optional'' โ additional row, as above.
** '''combatant1d'''/'''combatant2d'''/'''combatant3d''' โ ''optional'' โ additional row, as above.
** '''combatant1e'''/'''combatant2e'''/'''combatant3e''' โ ''optional'' โ additional row, as above.
* '''commander1'''/'''commander2'''/'''commander3''' โ ''optional'' โ the commanders of the military forces involved. For battles, this should include military commanders (and other officers as necessary). For wars, only prominent or notable leaders should be listed, with an upper limit of about seven per combatant column recommended. Ranks and position titles should be omitted. The {{tl|KIA}} and {{tl|POW}} templates may be included immediately after the names of commanders who were killed in action or surrendered and were taken prisoner, respectively. The '''commander3''' field can only be used if the '''combatant3''' field is set.
** '''commander1a'''/'''commander2a'''/'''commander3a''' โ ''optional'' โ in cases where the commanders significantly changed over the course of the conflict, these subsidiary fields may be used to provide additional rows for the '''commander''N''''' fields (above).
** '''commander1b'''/'''commander2b'''/'''commander3b''' โ ''optional'' โ additional row, as above.
** '''commander1c'''/'''commander2c'''/'''commander3c''' โ ''optional'' โ additional row, as above.
** '''commander1d'''/'''commander2d'''/'''commander3d''' โ ''optional'' โ additional row, as above.
** '''commander1e'''/'''commander2e'''/'''commander3e''' โ ''optional'' โ additional row, as above.
* '''units1'''/'''units2'''/'''units3''' โ ''optional'' โ the units or formations involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field. The '''units3''' field can only be used if the '''combatant3''' field is set.
* '''strength1'''/'''strength2''' โ ''optional'' โ the numerical strength of the units involved.
:* '''polstrength1'''/'''polstrength2''' โ ''optional'' โ In case of Coup d'Etat, political organizations that supported the government (1) respective the insurgents (2).
:* '''milstrength1'''/'''milstrength2''' โ ''optional'' โ In case of Coup d'Etat, military units that supported the government (1) respective the insurgents (2).
* '''strength3''' โ ''optional'' โ if '''combatant3''' is set, this is a third strength field identical to the two above; if it is '''''not''''' set, this is an alternate combined field for use where only the total participation in a conflict is known.
* '''casualties1'''/'''casualties2''' โ ''optional'' โ casualties suffered (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Note that this section of the infobox is headed "Casualties and losses". Terms such as "dead" (or "killed"), "wounded", or "captured" should be used in place of abbreviations such as "KIA" or "POW". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.
* '''casualties3''' โ ''optional'' โ if '''combatant3''' is set, this is a third casualty field identical to the two above; if it is '''''not''''' set, this is an alternate combined field for use where only the total casualties of a conflict are known, or where civilian casualties cannot be directly attributed to either side.
* '''notes''' โ ''optional'' โ optional field for further notes; this should only be used in exceptional circumstances.
* '''campaignbox''' โ ''optional'' โ optional field for appending a [[WP:CAMPAIGN|campaignbox template]] to the bottom of the infobox, which allows both boxes to float as a single element (useful if there are subsequent left floating images, which would otherwise not be able to float above the campaign box); the template must be specified in the format <nowiki>{{Campaignbox XYZ}}</nowiki>.<noinclude>
[[Category:WikiProject Military history template instructions|Military conflict infobox]]
</noinclude>{{Campaign/doc|noheader=yes}}
{{Operational plan/doc|noheader=yes}}
==Microformat==
{{UF-hcal-geo}}
== TemplateData ==
{{TemplateData header}}
{{collapse top|title=TemplateData}}
<templatedata>
{
"description": "Summarize information about a particular military conflict (a battle, campaign, war, or group of related wars).",
"format": "{{_\n| _________________ = _\n}}\n",
"params": {
"conflict": {
"label": "Conflict",
"description": "The name of the conflict being described.",
"type": "string/line",
"required": true
},
"width": {
"label": "Width",
"description": "Width of the infobox.",
"type": "string",
"default": "315px",
"required": false
},
"partof": {
"label": "Part of",
"description": "The larger conflict containing the event described in the article.",
"type": "wiki-page-name",
"required": false
},
"image": {
"label": "Image",
"description": "An image for the warbox given in the form Example.jpg.",
"type": "wiki-file-name",
"required": false
},
"image_size": {
"label": "Image size",
"description": "The size of the image",
"type": "string",
"required": false
},
"alt": {
"label": "Alt",
"description": "Alternative textual description of the image",
"type": "string",
"required": false
},
"caption": {
"label": "Caption",
"description": "The text to be placed below the image.",
"type": "string",
"required": false
},
"date": {
"label": "Date",
"description": "The date of the conflict described. Convention is to give the actual date for battles and the years for wars, but this does not always apply.",
"type": "string",
"required": false
},
"place": {
"label": "Place",
"description": "The location of the conflict.",
"type": "string",
"required": true
},
"coordinates": {
"label": "Coordinates",
"description": "The location of the structure, given as a coordinate pair by using {{coord}} with display=inline,title.",
"type": "string",
"required": false
},
"map_type": {
"label": "Map Type",
"description": "The base map to be used for the location map, e.g. \"Scotland\"; see {{location map}} for more details.",
"type": "string",
"required": false
},
"map_relief": {
"label": "Map Relief",
"description": "\"yes\" if the location map is a relief map.",
"type": "string",
"required": false
},
"map_size": {
"label": "Map Size",
"description": "Width of the location map in pixels (px).",
"type": "number",
"default": "220",
"required": false
},
"map_mark": {
"label": "Map Marker",
"description": "File to use as the location map marker.",
"type": "string",
"default": "red_pog.svg",
"required": false
},
"map_marksize": {
"label": "Map Marker Size",
"description": "Width of the location map marker in pixels (px).",
"type": "number",
"default": "8",
"required": false
},
"map_caption": {
"label": "Map Caption",
"description": "Caption displayed below the location map.",
"type": "string",
"default": "Location within {{{map_type}}}",
"required": false
},
"map_label": {
"label": "Map Label",
"description": "The label placed next to the marker on the location map.",
"type": "string/line",
"required": false
},
"territory": {
"label": "Territory",
"description": "Any changes in territorial control as a result of the conflict; this should not be used for overly lengthy descriptions of the peace settlement.",
"type": "string",
"required": false
},
"result": {
"label": "Result",
"description": "This parameter may use one of two standard terms: \"X victory\" or \"Inconclusive\". The term used is for the \"immediate\" outcome of the \"subject\" conflict and should reflect what the sources say. In cases where the standard terms do not accurately describe the outcome, a link or note should be made to the section of the article where the result is discussed in detail (such as \"See the Aftermath section\"). Such a note can also be used in conjunction with the standard terms but should not be used to conceal an ambiguity in the \"immediate\" result. Do not introduce non-standard terms like \"decisive\", \"marginal\" or \"tactical\", or contradictory statements like \"decisive tactical victory but strategic defeat\". Omit this parameter altogether rather than engage in speculation about which side won or by how much.",
"type": "string",
"required": false
},
"status": {
"label": "Status",
"description": "For ongoing conflicts, the current status of the conflict.",
"type": "string/line",
"required": false
},
"combatants_header": {
"label": "\"Combatants\" Header Text",
"description": "Sets the header text for the combatants section.",
"type": "string/line",
"default": "Belligerents",
"required": false
},
"combatant1": {
"label": "Combatant 1",
"description": "A party participating in the conflict.",
"type": "string",
"required": false
},
"combatant2": {
"label": "Combatant 2",
"description": "A party participating in the conflict.",
"type": "string",
"required": false
},
"combatant3": {
"label": "Combatant 3",
"description": "A party participating in the conflict. (only if the conflict has three distinct \"sides\")",
"type": "string",
"required": false
},
"combatant1a": {
"label": "Combatant 1a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2a": {
"label": "Combatant 2a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3a": {
"label": "Combatant 3a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1b": {
"label": "Combatant 1b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2b": {
"label": "Combatant 2b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3b": {
"label": "Combatant 3b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1c": {
"label": "Combatant 1c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2c": {
"label": "Combatant 2c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3c": {
"label": "Combatant 3c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1d": {
"label": "Combatant 1d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2d": {
"label": "Combatant 2d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3d": {
"label": "Combatant 3d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"commander1": {
"label": "Commander of Combatant 1",
"description": "The commanders of the military forces of Combatant (1) involved.",
"type": "string",
"required": false
},
"commander2": {
"label": "Commander of Combatant 2",
"description": "The commanders of the military forces of Combatant 2 involved.",
"type": "string",
"required": false
},
"commander3": {
"label": "Commander of Combatant 3",
"description": "The commanders of the military forces of Combatant 3 involved.",
"type": "string",
"required": false
},
"units1": {
"label": "Units of Combatant 1",
"description": "The units or formations of Combatant 1 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"units2": {
"label": "Units of Combatant 2",
"description": "The units or formations of Combatant 2 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"units3": {
"label": "Units of Combatant 3",
"description": "The units or formations of Combatant 3 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"strength1": {
"label": "Strength of Combatant 1",
"description": "The numerical strength of Combatant 1.",
"type": "string",
"required": false
},
"strength2": {
"label": "Strength of Combatant 2",
"description": "The numerical strength of Combatant 2.",
"type": "string",
"required": false
},
"strength3": {
"label": "Strength of Combatant 3",
"description": "If Combatant 3 is set, this field is for the numerical strength of Combatant 3. If Combatant 3 is not set, this is an alternate combined field for use where only the total participation in a conflict is known.",
"type": "string",
"required": false
},
"casualties1": {
"label": "Casualties of Combatant 1",
"description": "Casualties suffered by Combatant 1 (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.",
"type": "string",
"required": false
},
"casualties2": {
"label": "Casualties of Combatant 2",
"description": "Casualties suffered by Combatant 2 (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.",
"type": "string",
"required": false
},
"casualties3": {
"label": "Casualties of Combatant 3",
"description": "If Combatant 3 is set, this field is for the casualties suffered by Combatant 3, (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc. If combatant3 is not set, this is an alternate combined field for use where only the total casualties of a conflict are known, or where civilian casualties cannot be directly attributed to either side.",
"type": "string",
"required": false
},
"notes": {
"label": "Notes",
"description": "Optional field for further notes; this should only be used in exceptional circumstances.",
"type": "string",
"required": false
},
"campaignbox": {
"label": "Campaignbox",
"description": "Optional field for appending a campaignbox template to the bottom of the infobox, which allows both boxes to float as a single element (useful if there are subsequent left floating images, which would otherwise not be able to float above the campaign box); the template must be specified in the format {{Campaignbox XYZ}}.",
"type": "string",
"required": false
}
}
}</templatedata>
{{Collapse bottom}}
==See also==
*{{tl|Infobox military operation}}
*{{tl|Infobox civil conflict}}
*{{tl|Infobox civilian attack}}
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:War and conflict infobox templates| ]]
[[Category:Templates based on the Infobox Lua module]]
}}</includeonly>
b7bc1bfd8830e6f3810fed38740c84ef509585dd
Geotuber Ranking
0
2
219
16
2023-11-27T15:28:43Z
Kwe
5
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 3 ||๐ธ๐ฆ SSF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.448
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz|| align="right" | 9.447
|-
| 11 ||๐ฉ๐ช RomilZerna || align="right" | 9.442
|-
| 12 ||๐ฎ๐ถ Underrated Iraqi Edits|| align="right" | 9.439
|-
| 13 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.438
|-
| 14 ||๐ฎ๐ธ Thatdanishcountryball|| align="right" | 9.436
|-
| 15 ||๐ฆ๐ฒ ๐ฌ๐๐๐๐๐๐_๐ฐ๐๐๐๐ || align="right" | 9.436
|-
| 16 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 17 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 18 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 19 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 20 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
| 21 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
| 22 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 23 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
| 24 ||๐ต๐ฐ HexedGeography || align="right" | 9.413
|-
| 25 ||๐ต๐ฐ Moses || align="right" | 9.411
|-
8c65ece0c5b883fa6697d0abe15e7df51897f757
251
219
2023-11-27T19:04:23Z
Kwe
5
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 3 ||๐ธ๐ฆ SSF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.448
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz|| align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ถ Underrated Iraqi Edits|| align="right" | 9.439
|-
| 13 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.438
|-
| 14 ||๐ฎ๐ธ Thatdanishcountryball|| align="right" | 9.436
|-
| 15 ||๐ฆ๐ฒ ๐ฌ๐๐๐๐๐๐_๐ฐ๐๐๐๐ || align="right" | 9.436
|-
| 16 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 17 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 18 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 19 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 20 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
| 21 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
| 22 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 23 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
| 24 ||๐ต๐ฐ HexedGeography || align="right" | 9.413
|-
| 25 ||๐ต๐ฐ Moses || align="right" | 9.411
|-
835c0349df640480ca0c0cbf90833c8d472d67df
252
251
2023-11-27T19:08:06Z
Kwe
5
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 3 ||๐ธ๐ฆ SSF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.448
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.438
|-
| 14 ||๐ฎ๐ธ Thatdanishcountryball|| align="right" | 9.436
|-
| 15 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 16 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 17 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 18 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 19 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 20 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
| 21 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
| 22 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 23 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
| 24 ||๐ฉ๐ช RomilZerna || align="right" | 9.413
|-
| 25 ||๐ต๐ฐ Moses || align="right" | 9.411
|-
15301c9913e92622a89d2308bbc428b0eb869788
253
252
2023-11-27T19:14:17Z
Kwe
5
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 3 ||๐ธ๐ฆ SSF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.448
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ฎ๐ฉ Ralph Editor || align="right" | 9.439
|-
| 14 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.438
|-
| 15 ||๐ฎ๐ธ Thatdanishcountryball || align="right" | 9.436
|-
| 16 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 17 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 18 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 19 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 20 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 21 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
| 22 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
| 23 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 24 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
| 25 ||๐ฉ๐ช RomilZerna || align="right" | 9.413
|-
| 26 ||๐ต๐ฐ Moses || align="right" | 9.411
|-
| 27 ||๐ธ๐ช 2hand1000edits || aligh="right" | 9.410
0ad1ba0d49bdfb5e43c4e2a13a8775328ce9c730
File:PYSEC.png
6
107
220
2023-11-27T15:43:38Z
WikiA3ro
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:PYSEC.jpg
6
108
221
2023-11-27T15:52:09Z
WikiA3ro
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:AWPT.jpg
6
109
222
2023-11-27T15:52:40Z
WikiA3ro
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
PYSEC-AWPT Cold War
0
110
223
2023-11-27T16:07:20Z
WikiA3ro
2
Created page with "{{Infobox military conflict | conflict = | width = | partof = [[Geotuber Conflict]] | image = | image_size = | alt = | caption = | date = Since March 2023<ref>Most latest data i could find</ref> | place = Discord, Youtube | coordinates = <!--Use the {{coord}} template --> | map_type = | map_relief = | map_size = | map_marksize = | map_caption = | map_label = | territory = * Big wars and many members from..."
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| combatant2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
046737de0af2d2051460afdd1f8e82f5c4a90048
228
223
2023-11-27T16:20:42Z
WikiA3ro
2
Protected "[[PYSEC-AWPT Cold War]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| combatant2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
046737de0af2d2051460afdd1f8e82f5c4a90048
235
228
2023-11-27T16:26:55Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| combatant2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
<noinclude>This is a list of engagements during the PYSEC-AWPT Wars.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube [https://youtube.com]
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
fe9b553c1fc753cddf1db4da7b4b3df4cd7e8845
236
235
2023-11-27T16:27:48Z
WikiA3ro
2
/* Engagements */
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| combatant2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
<noinclude>This is a list of engagements during the PYSEC-AWPT Wars.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
39fe5589cb36b51ae8e2391ded5df701b9f601d3
241
236
2023-11-27T17:44:51Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| combatant2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as ip<ref>Probiball incident with EditsHorizon</ref>.
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
431e4cecdf293b5955af74d0a8804c6187e0583c
242
241
2023-11-27T17:45:24Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| combatant2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as ip<ref>Probiball incident with EditsHorizon</ref>.
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
3a2b3507b1208dfffdc989fdb6cdc5dd5b7b7d68
246
242
2023-11-27T17:48:41Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| combatant2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as ip<ref>Probiball incident with EditsHorizon</ref>.
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
688043f3cc8f848657f1ccd67eacd9d2b25ea6ff
First Pysec-Awpt War
0
111
224
2023-11-27T16:16:48Z
WikiA3ro
2
Created page with "{{Infobox military conflict | conflict = | width = | partof = [[PYSEC-AWPT Cold War]] | image = | image_size = | alt = | caption = | date = 25 April 2023 | place = Discord, Youtube | coordinates = <!--Use the {{coord}} template --> | map_type = | map_relief = | map_size = | map_marksize = | map_caption = | map_label = | territory = | result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks..."
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
On 25 April 2023, there was a incident where EditsHorizon, leaked a PYSEC member's personal information, when probiball saw this he took action.
==Background==
Once upon a time in discord and youtube, Probibal and UmarEdits found themselves in a big disagreement. Probibal decided to do something not so nice and shared personal information about EditsHorizon, causing a lot of trouble. At the same time, UmarEdits declared war on AWPT, and it created a lot of confusion and chaos for days.
During all this craziness, members from Pysec and AWPT were secretly getting involved and spying on each other's servers. Pysec even closed their invites for a while, and AWPT did the same. Some people from Pakistan in the AWPT server got banned because they were spamming messages, and a similar thing happened in Pysec with AWPT members spamming there too.
It was a wild time in discord as well as in youtube with lots of mistakes and surprises, but Probibal had a plan and knew what to do to stir things up even more.
==Aftermath==
Following all the chaos, a bunch of AWPT and Pysec members decided they'd had enough and left the servers. It seemed like they disappeared and never came back to continue the fight for their respective groups. The both servers became a bit quieter as these members chose to step away from the ongoing server drama.
==List of engagements in this war==
* [[Operation TRL]]
* [[7 Minutes Clash]]
==References==
6d839f2cce04a3be376435cee221fb3055cb8c24
229
224
2023-11-27T16:20:59Z
WikiA3ro
2
Protected "[[First Pysec-Awpt War]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
On 25 April 2023, there was a incident where EditsHorizon, leaked a PYSEC member's personal information, when probiball saw this he took action.
==Background==
Once upon a time in discord and youtube, Probibal and UmarEdits found themselves in a big disagreement. Probibal decided to do something not so nice and shared personal information about EditsHorizon, causing a lot of trouble. At the same time, UmarEdits declared war on AWPT, and it created a lot of confusion and chaos for days.
During all this craziness, members from Pysec and AWPT were secretly getting involved and spying on each other's servers. Pysec even closed their invites for a while, and AWPT did the same. Some people from Pakistan in the AWPT server got banned because they were spamming messages, and a similar thing happened in Pysec with AWPT members spamming there too.
It was a wild time in discord as well as in youtube with lots of mistakes and surprises, but Probibal had a plan and knew what to do to stir things up even more.
==Aftermath==
Following all the chaos, a bunch of AWPT and Pysec members decided they'd had enough and left the servers. It seemed like they disappeared and never came back to continue the fight for their respective groups. The both servers became a bit quieter as these members chose to step away from the ongoing server drama.
==List of engagements in this war==
* [[Operation TRL]]
* [[7 Minutes Clash]]
==References==
6d839f2cce04a3be376435cee221fb3055cb8c24
231
229
2023-11-27T16:21:57Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Youtube post deleted<ref>No longer found in youtube</ref?
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
On 25 April 2023, there was a incident where EditsHorizon, leaked a PYSEC member's personal information, when probiball saw this he took action.
==Background==
Once upon a time in discord and youtube, Probibal and UmarEdits found themselves in a big disagreement. Probibal decided to do something not so nice and shared personal information about EditsHorizon, causing a lot of trouble. At the same time, UmarEdits declared war on AWPT, and it created a lot of confusion and chaos for days.
During all this craziness, members from Pysec and AWPT were secretly getting involved and spying on each other's servers. Pysec even closed their invites for a while, and AWPT did the same. Some people from Pakistan in the AWPT server got banned because they were spamming messages, and a similar thing happened in Pysec with AWPT members spamming there too.
It was a wild time in discord as well as in youtube with lots of mistakes and surprises, but Probibal had a plan and knew what to do to stir things up even more.
==Aftermath==
Following all the chaos, a bunch of AWPT and Pysec members decided they'd had enough and left the servers. It seemed like they disappeared and never came back to continue the fight for their respective groups. The both servers became a bit quieter as these members chose to step away from the ongoing server drama.
==List of engagements in this war==
* [[Operation TRL]]
* [[7 Minutes Clash]]
==References==
b397790d31923daef542b7bc53fe8f355d70c1f1
233
231
2023-11-27T16:24:07Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Youtube post deleted<ref>No longer found in youtube</ref>
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
On 25 April 2023, there was a incident where EditsHorizon, leaked a PYSEC member's personal information, when probiball saw this he took action.
==Background==
Once upon a time in discord and youtube, Probibal and UmarEdits found themselves in a big disagreement. Probibal decided to do something not so nice and shared personal information about EditsHorizon, causing a lot of trouble. At the same time, UmarEdits declared war on AWPT, and it created a lot of confusion and chaos for days.
During all this craziness, members from Pysec and AWPT were secretly getting involved and spying on each other's servers. Pysec even closed their invites for a while, and AWPT did the same. Some people from Pakistan in the AWPT server got banned because they were spamming messages, and a similar thing happened in Pysec with AWPT members spamming there too.
It was a wild time in discord as well as in youtube with lots of mistakes and surprises, but Probibal had a plan and knew what to do to stir things up even more.
==Aftermath==
Following all the chaos, a bunch of AWPT and Pysec members decided they'd had enough and left the servers. It seemed like they disappeared and never came back to continue the fight for their respective groups. The both servers became a bit quieter as these members chose to step away from the ongoing server drama.
==List of engagements in this war==
* [[Operation TRL]]
* [[7 Minutes Clash]]
==References==
ba7200cc381faaf680462852d67994bbfaec99ef
243
233
2023-11-27T17:47:31Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Youtube post deleted<ref>No longer found in youtube</ref>
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender
'' (PYSEC claim) ''
| casualties3 =
| notes =
| campaignbox =
}}
On 25 April 2023, there was a incident where EditsHorizon, leaked a PYSEC member's personal information, when probiball saw this he took action.
==Background==
Once upon a time in discord and youtube, Probibal and UmarEdits found themselves in a big disagreement. Probibal decided to do something not so nice and shared personal information about EditsHorizon, causing a lot of trouble. At the same time, UmarEdits declared war on AWPT, and it created a lot of confusion and chaos for days.
During all this craziness, members from Pysec and AWPT were secretly getting involved and spying on each other's servers. Pysec even closed their invites for a while, and AWPT did the same. Some people from Pakistan in the AWPT server got banned because they were spamming messages, and a similar thing happened in Pysec with AWPT members spamming there too.
It was a wild time in discord as well as in youtube with lots of mistakes and surprises, but Probibal had a plan and knew what to do to stir things up even more.
==Aftermath==
Following all the chaos, a bunch of AWPT and Pysec members decided they'd had enough and left the servers. It seemed like they disappeared and never came back to continue the fight for their respective groups. The both servers became a bit quieter as these members chose to step away from the ongoing server drama.
==List of engagements in this war==
* [[Operation TRL]]
* [[7 Minutes Clash]]
==References==
c1794e72456db8c173038370603fcb33966311bb
244
243
2023-11-27T17:47:49Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Edits Horizon Youtube post deleted<ref>No longer found in youtube</ref>
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender
'' (PYSEC claim) ''
| casualties3 =
| notes =
| campaignbox =
}}
On 25 April 2023, there was a incident where EditsHorizon, leaked a PYSEC member's personal information, when probiball saw this he took action.
==Background==
Once upon a time in discord and youtube, Probibal and UmarEdits found themselves in a big disagreement. Probibal decided to do something not so nice and shared personal information about EditsHorizon, causing a lot of trouble. At the same time, UmarEdits declared war on AWPT, and it created a lot of confusion and chaos for days.
During all this craziness, members from Pysec and AWPT were secretly getting involved and spying on each other's servers. Pysec even closed their invites for a while, and AWPT did the same. Some people from Pakistan in the AWPT server got banned because they were spamming messages, and a similar thing happened in Pysec with AWPT members spamming there too.
It was a wild time in discord as well as in youtube with lots of mistakes and surprises, but Probibal had a plan and knew what to do to stir things up even more.
==Aftermath==
Following all the chaos, a bunch of AWPT and Pysec members decided they'd had enough and left the servers. It seemed like they disappeared and never came back to continue the fight for their respective groups. The both servers became a bit quieter as these members chose to step away from the ongoing server drama.
==List of engagements in this war==
* [[Operation TRL]]
* [[7 Minutes Clash]]
==References==
6045bca9146b90c4ec8625951447681d43f4d045
245
244
2023-11-27T17:48:24Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Edits Horizon Youtube post deleted<ref>No longer found in youtube</ref>
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender
'' (PYSEC claim) ''
| casualties3 =
| notes =
| campaignbox =
}}
On 25 April 2023, there was a incident where EditsHorizon, leaked a PYSEC member's personal information, when probiball saw this he took action.
==Background==
Once upon a time in discord and youtube, Probibal and UmarEdits found themselves in a big disagreement. Probibal decided to do something not so nice and shared personal information about EditsHorizon, causing a lot of trouble. At the same time, UmarEdits declared war on AWPT, and it created a lot of confusion and chaos for days.
During all this craziness, members from Pysec and AWPT were secretly getting involved and spying on each other's servers. Pysec even closed their invites for a while, and AWPT did the same. Some people from Pakistan in the AWPT server got banned because they were spamming messages, and a similar thing happened in Pysec with AWPT members spamming there too.
It was a wild time in discord as well as in youtube with lots of mistakes and surprises, but Probibal had a plan and knew what to do to stir things up even more.
==Aftermath==
Following all the chaos, a bunch of AWPT and Pysec members decided they'd had enough and left the servers. It seemed like they disappeared and never came back to continue the fight for their respective groups. The both servers became a bit quieter as these members chose to step away from the ongoing server drama.
==List of engagements in this war==
* [[Operation TRL]]
* [[7 Minutes Clash]]
==References==
bde4d7bc89f06455cf187db799b3f9de186a864b
Operation TRL
0
112
225
2023-11-27T16:19:05Z
WikiA3ro
2
Created page with "{{Infobox military conflict | conflict = | width = | partof = [[PYSEC-AWPT Cold War]] | image = | image_size = | alt = | caption = | date = 25 April 2023 | place = Discord, Youtube | coordinates = <!--Use the {{coord}} template --> | map_type = | map_relief = | map_size = | map_marksize = | map_caption = | map_label = | territory = | result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks..."
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
'''''for further understanding, read [[First Pysec-Awpt War]]'''''
01663c0dfa8e19ad95705e15293116eeaf523877
230
225
2023-11-27T16:21:10Z
WikiA3ro
2
Protected "[[Operation TRL]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
'''''for further understanding, read [[First Pysec-Awpt War]]'''''
01663c0dfa8e19ad95705e15293116eeaf523877
234
230
2023-11-27T16:24:34Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
'''''for further understanding, read [[First Pysec-Awpt War]]'''''
==References==
74d942c3e4182d11410fdbae1c89e1e064a496f1
247
234
2023-11-27T17:50:08Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
'''''for further understanding, read [[First Pysec-Awpt War]]'''''
==References==
4823a930bfa1f287892dd992dcde7c5500528fcb
7 Minutes Clash
0
113
226
2023-11-27T16:20:17Z
WikiA3ro
2
Created page with "{{Infobox military conflict | conflict = | width = | partof = [[PYSEC-AWPT Cold War]] | image = | image_size = | alt = | caption = | date = 27 April 2023 | place = Discord, Youtube | coordinates = <!--Use the {{coord}} template --> | map_type = | map_relief = | map_size = | map_marksize = | map_caption = | map_label = | territory = | result = [[file:AWPT.jpg|23px]] AWPT victory<ref>AWPT clears the p..."
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 27 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|23px]] AWPT victory<ref>AWPT clears the pakistani members</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
670c65e73b6843cd193825ec356599c631dd70ea
227
226
2023-11-27T16:20:30Z
WikiA3ro
2
Protected "[[7 Minutes Clash]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 27 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|23px]] AWPT victory<ref>AWPT clears the pakistani members</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
670c65e73b6843cd193825ec356599c631dd70ea
232
227
2023-11-27T16:23:51Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 27 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|23px]] AWPT victory<ref>AWPT clears the pakistani members</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
very small incident to describe, however it is when AWPT manage to clear and ban almost all pakistani members in AWPT in around 7 minutes<ref>their claim</ref>
'''''for further understanding, go to [[First Pysec-Awpt War]].'''''
==References==
8ca97d0ff8c84af7ef93423bb64955cad549d22a
248
232
2023-11-27T17:51:06Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 27 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|23px]] AWPT victory<ref>AWPT clears the pakistani members</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
very small incident to describe, however it is when AWPT manage to clear and ban almost all pakistani members in AWPT in around 7 minutes<ref>Not exactly seven minutes but around seven minutes</ref>
'''''for further understanding, go to [[First Pysec-Awpt War]].'''''
==References==
7e2bc8d611f11ba693f6a053560aafddaff30379
249
248
2023-11-27T17:52:22Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict = 7 Minute Clash (codenamed: The Minute Battle)
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 27 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|23px]] AWPT victory<ref>AWPT clears the pakistani members</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
very small incident to describe, however it is when AWPT manage to clear and ban almost all pakistani members in AWPT in around 7 minutes<ref>Not exactly seven minutes but around seven minutes</ref>
'''''for further understanding, go to [[First Pysec-Awpt War]].'''''
==References==
bb513b78a06ef6ac328ea282b2e52fd23261dc11
250
249
2023-11-27T17:53:15Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict = 7 Minute Clash (codenamed: The Minute Battle)
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 27 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|23px]] AWPT victory<ref>AWPT clears the pakistani members</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acdevin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
very small incident to describe, however it is when AWPT manage to clear and ban almost all pakistani members in AWPT in around 7 minutes<ref>Not exactly seven minutes but around seven minutes</ref>
'''''for further understanding, go to [[First Pysec-Awpt War]].'''''
==References==
7ed9e9b21739fa26cbd656b4f0aeabfbb3c37092
File:TGK.jpg
6
114
237
2023-11-27T16:29:18Z
WikiA3ro
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Delete.png
6
115
238
2023-11-27T16:38:57Z
WikiA3ro
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
End of TheGamingKing
0
116
239
2023-11-27T16:43:25Z
WikiA3ro
2
Created page with "{{Infobox military conflict | conflict = | width = | partof = [[PYSEC-AWPT Cold War]] | image = Delete.png | image_size = | alt = | caption = TGK channel no longer accesible | date = March 2023 | place = Youtube | coordinates = <!--Use the {{coord}} template --> | map_type = | map_relief = | map_size = | map_marksize = | map_caption = | map_label = | territory = | result = [[file:AWPT.jpg|28px]] AWPT..."
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image = Delete.png
| image_size =
| alt =
| caption = TGK channel no longer accesible
| date = March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT celebrates victory</ref><ref>AWPT plan has been succesfull</ref><ref>TheGamingKing Terminated on youtube</ref><ref>Many AWPT members strike TGK</ref>
| status =
| combatants_header =
| combatant1 =
* [[file:TGK.jpg|29px]] TGK
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
* [[file:TGK.jpg|28px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] AWPT Alliance
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = TGK Terminated<ref>upper referenes</ref>
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
Since start, AWPT had many plans to terminate TGK, but on any point of march, this plan was succesfull<ref>AWPT terminates TGK</ref>
==Background==
TGK created different videos responding to Indians, poking fun at their country and its friends. Indians didn't appreciate the jokes about their homeland and decided to oppose him, maybe even getting him kicked out to keep him away<ref>termination main point</ref>.
==References==
dc7fd1639cb345261f9ce0dcf65a1d4d8c501f84
Geotuber Conflict
0
5
240
17
2023-11-27T17:39:04Z
WikiA3ro
2
wikitext
text/x-wiki
'''''if you want your wars, or want to add wars, please go to the discussion tab on this page.'''''
A '''geotuber conflict''' is when two participants have a conflict, and they declare a war on each other. They bring their Allies and fight till they reach their main goals. One of the most famous rivarlies war were of non other than [[PYSEC-AWPT Cold War]], the two alliances are from Pakistan and India, which both countries in real life have a rivarly too<ref>https://en.wikipedia.org/wiki/India%E2%80%93Pakistan_relations</ref>
==Check out==
* [[List of engagements between PYSEC and AWPT|PYSEC-AWPT Wars]]
==References==
5f59258b2f32d286484b8d613e9fd158babf2868
Geotuber Ranking
0
2
254
253
2023-11-27T19:14:52Z
Kwe
5
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 3 ||๐ธ๐ฆ SSF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.448
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ฎ๐ฉ Ralph Editor || align="right" | 9.439
|-
| 14 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.438
|-
| 15 ||๐ฎ๐ธ Thatdanishcountryball || align="right" | 9.436
|-
| 16 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 17 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 18 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 19 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 20 ||๐ซ๐ท French_General || align="right" | 9.426
|-
| 21 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
| 22 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
| 23 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 24 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
| 25 ||๐ฉ๐ช RomilZerna || align="right" | 9.413
|-
| 26 ||๐ต๐ฐ Moses || align="right" | 9.411
|-
| 27 ||๐ธ๐ช 2hand1000edits || align="right" | 9.410
b1de9e4fe1553fb1d880182a7c844766c43e8408
255
254
2023-11-27T19:56:47Z
Kwe
5
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.467
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 3 ||๐ธ๐ฆ SSF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.448
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ซ๐ท French_General || align="right" | 9.439
|-
| 14 ||๐ฎ๐ฉ Ralph Editor || align="right" | 9.438
|-
| 15 ||๐ฎ๐ธ Thatdanishcountryball || align="right" | 9.436
|-
| 16 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 17 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 18 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 19 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 20 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.426
|-
| 21 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
| 22 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
| 23 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 24 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
| 25 ||๐ฉ๐ช RomilZerna || align="right" | 9.413
|-
| 26 ||๐ต๐ฐ Moses || align="right" | 9.411
|-
| 27 ||๐ธ๐ช 2hand1000edits || align="right" | 9.410
49167d3a1784d9792b338a6cf657a5840f8c7ad0
259
255
2023-11-28T11:17:12Z
WikiA3ro
2
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.450
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 3 ||๐ธ๐ฆ SSF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.448
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ซ๐ท French_General || align="right" | 9.439
|-
| 14 ||๐ฎ๐ฉ Ralph Editor || align="right" | 9.438
|-
| 15 ||๐ฎ๐ธ Thatdanishcountryball || align="right" | 9.436
|-
| 16 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 17 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 18 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 19 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 20 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.426
|-
| 21 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
| 22 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
| 23 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 24 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
| 25 ||๐ฉ๐ช RomilZerna || align="right" | 9.413
|-
| 26 ||๐ต๐ฐ Moses || align="right" | 9.411
|-
| 27 ||๐ธ๐ช 2hand1000edits || align="right" | 9.410
5cb60b6b1d23625ab002ccc151e9cebb5bb782c5
283
259
2023-11-29T15:35:15Z
WikiA3ro
2
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.450
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 3 ||๐ธ๐ฆ SSF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.448
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ซ๐ท French_General || align="right" | 9.439
|-
| 14 ||๐ฎ๐ฉ Ralph Editor || align="right" | 9.438
|-
| 15 ||๐ฎ๐ธ Thatdanishcountryball || align="right" | 9.436
|-
| 16 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 17 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 18 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 19 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 20 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.426
|-
| 21 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
| 22 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
| 23 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 24 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
| 25 ||๐ฉ๐ช RomilZerna || align="right" | 9.413
|-
| 26 ||๐ต๐ฐ Moses || align="right" | 9.411
|-
| 27 ||๐ธ๐ช 2hand1000edits || align="right" | 9.410
|-
| 28 ||๐ฌ๐ง memoryballsedits || align="right" | 9.408
4c3467578a4b1026f3dec36deec45e11ee73cfec
285
283
2023-11-29T15:38:09Z
WikiA3ro
2
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
It also adds where the better or worse the geotuber video makes, the more increase/decrease his/her rankings get.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.450
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 3 ||๐ธ๐ฆ SSF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.448
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ซ๐ท French_General || align="right" | 9.439
|-
| 14 ||๐ฎ๐ฉ Ralph Editor || align="right" | 9.438
|-
| 15 ||๐ฎ๐ธ Thatdanishcountryball || align="right" | 9.436
|-
| 16 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 17 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 18 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 19 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 20 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.426
|-
| 21 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.421
|-
| 22 ||๐ป๐ณ Coconutz || align="right" | 9.420
|-
| 23 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 24 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
| 25 ||๐ฉ๐ช RomilZerna || align="right" | 9.413
|-
| 26 ||๐ต๐ฐ Moses || align="right" | 9.411
|-
| 27 ||๐ธ๐ช 2hand1000edits || align="right" | 9.410
|-
| 28 ||๐ฌ๐ง memoryballsedits || align="right" | 9.408
000b112f099823660953d366fd78a4c85c072afe
286
285
2023-11-30T01:39:48Z
Kwe
5
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
It also adds where the better or worse the geotuber video makes, the more increase/decrease his/her rankings get.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ต๐ฐ IFS|| align="right" | 9.450
|-
| 2 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 3 ||๐ธ๐ฆ SSF || align="right" | 9.461
|-
| 4 ||๐ป๐ณ FOX.F || align="right" | 9.454
|-
| 5 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.448
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ซ๐ท French_General || align="right" | 9.439
|-
| 14 ||๐ฎ๐ฉ Ralph Editor || align="right" | 9.438
|-
| 15 ||๐ฎ๐ธ Thatdanishcountryball || align="right" | 9.436
|-
| 16 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 17 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 18 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 19 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 20 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.426
|-
| 21 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.421
|-
| 22 ||๐ท๐บ George0416 || align="right" | 9.420
|-
| 23 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 24 ||๐ณ๐ฑ SnorProductions || align="right" | 9.414
|-
| 25 ||๐ท๐บ TheSavMoroz || align="right" | 9.413
|-
| 26 ||๐ต๐ฐ Moses || align="right" | 9.412
|-
| 27 ||๐ฉ๐ช RomilZerna || align="right" | 9.411
|-
| 28 ||๐ธ๐ช 2hand1000edits || align="right" | 9.410
|-
| 29 ||๐ฌ๐ง Memoryballsedits || align="right" | 9.408
|-
| 30 ||๐ป๐ณ Coconutz || align="right" | 9.394
|-
| 31 ||๐ฉ๐ช HGM || align="right" | 9.389
|-
| 32 ||๐ฌ๐ง ThatFlagGuy || align="right" | 9.383
6f5d0b4a822375e1c6c3f963198314a5f841969e
287
286
2023-11-30T01:45:17Z
Kwe
5
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
It also adds where the better or worse the geotuber video makes, the more increase/decrease his/her rankings get.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 2 ||๐ต๐ฐ IFS|| align="right" | 9.459
|-
| 3 ||๐ป๐ณ FOX.F || align="right" | 9.455
|-
| 4 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 5 ||๐ธ๐ฆ SSF || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.448
|-
| 10 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ฎ๐ฉ Ralph Editor || align="right" | 9.439
|-
| 14 ||๐ณ๐ฑ SnorProductions || align="right" | 9.438
|-
| 15 ||๐ซ๐ท French_General || align="right" | 9.436
|-
| 16 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 17 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 18 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 19 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 20 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.426
|-
| 21 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.421
|-
| 22 ||๐ท๐บ George0416 || align="right" | 9.420
|-
| 23 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 24 ||๐ฎ๐ธ Thatdanishcountryball || align="right" | 9.414
|-
| 25 ||๐ท๐บ TheSavMoroz || align="right" | 9.413
|-
| 26 ||๐ต๐ฐ Moses || align="right" | 9.412
|-
| 27 ||๐ฉ๐ช RomilZerna || align="right" | 9.411
|-
| 28 ||๐ธ๐ช 2hand1000edits || align="right" | 9.410
|-
| 29 ||๐ฌ๐ง Memoryballsedits || align="right" | 9.408
|-
| 30 ||๐ป๐ณ Coconutz || align="right" | 9.394
|-
| 31 ||๐ฉ๐ช HGM || align="right" | 9.389
|-
| 32 ||๐ฌ๐ง ThatFlagGuy || align="right" | 9.383
30140c63607049804e516a5c0f001b0df7c3fdeb
288
287
2023-11-30T01:47:15Z
Kwe
5
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
It also adds where the better or worse the geotuber video makes, the more increase/decrease his/her rankings get.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 2 ||๐ต๐ฐ IFS|| align="right" | 9.459
|-
| 3 ||๐ป๐ณ FOX.F || align="right" | 9.455
|-
| 4 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 5 ||๐ธ๐ฆ SSF || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.448
|-
| 10 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ฎ๐ฉ Ralph Editor || align="right" | 9.439
|-
| 14 ||๐ณ๐ฑ SnorProductions || align="right" | 9.438
|-
| 15 ||๐ซ๐ท French_General || align="right" | 9.436
|-
| 16 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 17 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 18 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 19 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 20 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.426
|-
| 21 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.421
|-
| 22 ||๐ท๐บ George0416 || align="right" | 9.420
|-
| 23 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 24 ||๐ฎ๐ธ Thatdanishcountryball || align="right" | 9.414
|-
| 25 ||๐ท๐บ TheSavMoroz || align="right" | 9.413
|-
| 26 ||๐ต๐ฐ Moses || align="right" | 9.412
|-
| 27 ||๐ฉ๐ช RomilZerna || align="right" | 9.411
|-
| 28 ||๐ธ๐ช 2hand1000edits || align="right" | 9.410
|-
| 29 ||๐ฌ๐ง Memoryballsedits || align="right" | 9.408
|-
| 30 ||๐ป๐ณ Coconutz || align="right" | 9.394
|-
| 31 ||๐ฉ๐ช HGM || align="right" | 9.389
|-
| 32 ||๐ฌ๐ง ThatFlagGuy || align="right" | 9.383
be80e0d5ebe786fa5d1745728aaf0c105047adb8
290
288
2023-11-30T03:09:10Z
Kwe
5
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
It also adds where the better or worse the geotuber video makes, the more increase/decrease his/her rankings get.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 2 ||๐ต๐ฐ IFS|| align="right" | 9.459
|-
| 3 ||๐ป๐ณ FOX.F || align="right" | 9.455
|-
| 4 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 5 ||๐ธ๐ฆ SSF || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.448
|-
| 10 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ฎ๐ฉ Ralph Editor || align="right" | 9.439
|-
| 14 ||๐ณ๐ฑ SnorProductions || align="right" | 9.438
|-
| 15 ||๐ซ๐ท French_General || align="right" | 9.436
|-
| 16 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 17 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 18 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 19 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 20 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.426
|-
| 21 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.421
|-
| 22 ||๐ท๐บ George0416 || align="right" | 9.420
|-
| 23 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 24 ||๐ฎ๐ธ Thatdanishcountryball || align="right" | 9.414
|-
| 25 ||๐ท๐บ TheSavMoroz || align="right" | 9.413
|-
| 26 ||๐ต๐ฐ Moses || align="right" | 9.412
|-
| 27 ||๐ฉ๐ช RomilZerna || align="right" | 9.411
|-
| 28 ||๐ธ๐ช 2hand1000edits || align="right" | 9.410
|-
| 29 ||๐ฌ๐ง Memoryballsedits || align="right" | 9.408
|-
| 30 ||๐ป๐ณ Coconutz || align="right" | 9.394
|-
| 31 ||๐ฉ๐ช HGM || align="right" | 9.389
|-
| 32 ||๐ฌ๐ง ThatFlagGuy || align="right" | 9.383
|-
| 33 ||๐ป๐ณ Tra_Editz || align="right" | 9.381
|-
| 34 ||๐น๐ท MuslimTurkEditz || align='right' | 9.374
9a30ca9c1e65db9f2b6f02e20e9f395d9bc63520
291
290
2023-11-30T03:15:00Z
Kwe
5
wikitext
text/x-wiki
[[Geotuber Ranking]] is a ranking of geotubers around the world. It is calculated by the average rating, with the following factors:
Quality, Sync, Skill, Consistency, edit time, YouTube knowledge and more.
It also adds where the better or worse the geotuber video makes, the more increase/decrease his/her rankings get.
Here is the list of the top geotubers:
{| class=wikitable
|----- bgcolor="#efefef"
! Pos
! Geotuber
! Average Rating
|-
| 1 ||๐ฒ๐ณ Militrizatixn || align="right" | 9.465
|-
| 2 ||๐ต๐ฐ IFS|| align="right" | 9.459
|-
| 3 ||๐ป๐ณ FOX.F || align="right" | 9.455
|-
| 4 ||๐ป๐ณ magball || align="right" | 9.454
|-
| 5 ||๐ธ๐ฆ SSF || align="right" | 9.454
|-
| 6 ||๐ต๐ฆ WILLY-NICX|| align="right" | 9.453
|-
| 7 ||๐ฎ๐ฑ CoEditzMass|| align="right" | 9.450
|-
| 8 ||๐น๐ญ Gabby_YT|| align="right" | 9.450
|-
| 9 ||๐ฐ๐ท KoreanWorldEditz || align="right" | 9.448
|-
| 10 ||๐ซ๐ฎ OnlyFlags6K || align="right" | 9.447
|-
| 11 ||๐บ๐ฆ TheElmie || align="right" | 9.442
|-
| 12 ||๐ฎ๐ฑ Splatifpv1 || align="right" | 9.439
|-
| 13 ||๐ฎ๐ฉ Ralph Editor || align="right" | 9.439
|-
| 14 ||๐ณ๐ฑ SnorProductions || align="right" | 9.438
|-
| 15 ||๐ซ๐ท French_General || align="right" | 9.436
|-
| 16 ||๐ฆ๐ฒ Artsakh_Edits || align="right" | 9.436
|-
| 17 ||๐ป๐ณ CallmeCroisy || align="right" | 9.435
|-
| 18 ||๐ต๐ฐ A3ro || align="right" | 9.434
|-
| 19 ||๐ฆ๐ช UAE_Geo.Editz || align="right" | 9.430
|-
| 20 ||๐ต๐ฐ Lightanitor Geography || align="right" | 9.426
|-
| 21 ||๐ฎ๐ถ Underrated Iraqi Edits || align="right" | 9.421
|-
| 22 ||๐ป๐ณ Tra_Editz || align="right" | 9.420
|-
| 23 ||๐ป๐ณ Hunter29kVN || align="right" | 9.416
|-
| 24 ||๐ฎ๐ธ Thatdanishcountryball || align="right" | 9.414
|-
| 25 ||๐ท๐บ TheSavMoroz || align="right" | 9.413
|-
| 26 ||๐ต๐ฐ Moses || align="right" | 9.412
|-
| 27 ||๐ฉ๐ช RomilZerna || align="right" | 9.411
|-
| 28 ||๐ธ๐ช 2hand1000edits || align="right" | 9.410
|-
| 29 ||๐ฌ๐ง Memoryballsedits || align="right" | 9.408
|-
| 30 ||๐ป๐ณ Coconutz || align="right" | 9.394
|-
| 31 ||๐ฉ๐ช HGM || align="right" | 9.389
|-
| 32 ||๐ฌ๐ง ThatFlagGuy || align="right" | 9.383
|-
| 33 ||๐ท๐บ George0416 || align="right" | 9.381
|-
| 34 ||๐น๐ท MuslimTurkEditz || align='right' | 9.374
52c51f1401396581960fb2b1209ffcb51673711e
User:FSgeo1
2
117
256
2023-11-28T02:40:53Z
FSgeo1
11
Huh
wikitext
text/x-wiki
So uhh people call me geo and I like to edit and love all countries also play Roblox and I edit on Alight Motion also I'm Christian.
b89b3b4388672fcf852e57c9a28f81cad955ec01
User:RALPH EDITOR
2
118
257
2023-11-28T09:33:57Z
RALPH EDITOR
14
Geotuber Indonesia Dude who Always Edit Country Vs Country Editing ๐ค
wikitext
text/x-wiki
Ralph editor
Software Editing he use: Alight motion
Where he from: Indonesia๐ฎ๐ฉ
Where he live: Jakarta
Indonesia Geotuber Country Vs Country Editing
19a539e26a5d4bcdd1f9b29d294d73359eb041cb
User:ThatPolishEditor861
2
119
258
2023-11-28T09:59:31Z
ThatPolishEditor861
15
Created page with "Software he use: alight motion, sometimes cap cut Where is he from: Poland Where does he live: Zielona Gรณra (Lubuskie) Country vs country editor"
wikitext
text/x-wiki
Software he use: alight motion, sometimes cap cut
Where is he from: Poland
Where does he live: Zielona Gรณra (Lubuskie)
Country vs country editor
f785df89a97152816358c09ba7c38b623a600f09
Talk:Geotuber Ranking
1
4
260
13
2023-11-28T11:19:44Z
HumilatedGeon
16
/* Romilzerna Ranking */ new section
wikitext
text/x-wiki
==if you want to add or change any rankings, discuss here!==
== Romilzerna Ranking ==
How can romilzerna be under my 20? He should be 1 or 2 [[User:HumilatedGeon|HumilatedGeon]] ([[User talk:HumilatedGeon|talk]]) 11:19, 28 November 2023 (UTC)
dd5a88df6f31a1c36d3f5e7ee125058ea0f808ef
284
260
2023-11-29T15:37:12Z
WikiA3ro
2
/* Romilzerna Ranking */
wikitext
text/x-wiki
==if you want to add or change any rankings, discuss here!==
== Romilzerna Ranking ==
How can romilzerna be under my 20? He should be 1 or 2 [[User:HumilatedGeon|HumilatedGeon]] ([[User talk:HumilatedGeon|talk]]) 11:19, 28 November 2023 (UTC)
You ok lol? [[User:WikiA3ro]] ([[User talk:WikiA3ro|talk]]) 7:37, 29 November 2023 (UTC)
e5565d7754917d1a19b54f40513ff9d45d166dfc
289
284
2023-11-30T01:50:54Z
Kwe
5
/* Romilzerna Ranking */
wikitext
text/x-wiki
==if you want to add or change any rankings, discuss here!==
== Romilzerna Ranking ==
How can romilzerna be under my 20? He should be 1 or 2 [[User:HumilatedGeon|HumilatedGeon]] ([[User talk:HumilatedGeon|talk]]) 11:19, 28 November 2023 (UTC)
You ok lol? [[User:WikiA3ro]] ([[User talk:WikiA3ro|talk]]) 7:37, 29 November 2023 (UTC)
HAHAHA ROMILZERNA 1 OR 2??
306b3f758026871f42275530f4d44add15343f04
Geotuber Conflict
0
5
261
240
2023-11-28T11:45:18Z
WikiA3ro
2
wikitext
text/x-wiki
'''''if you want your wars, or want to add wars, please go to the discussion tab on this page.'''''
A '''geotuber conflict''' is when two participants have a conflict, and they declare a war on each other. They bring their Allies and fight till they reach their main goals. One of the most famous rivarlies war were of non other than [[PYSEC-AWPT Cold War]], the two alliances are from Pakistan and India, which both countries in real life have a rivarly too<ref>https://en.wikipedia.org/wiki/India%E2%80%93Pakistan_relations</ref>
==Check out==
* [[PYSEC-AWPT Cold War]]
==References==
ca8ab66890b05a05357cafafd2eb608f4ade767c
PYSEC-AWPT Cold War
0
110
262
246
2023-11-28T11:45:55Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
* Many treaties but none really going as plannee<ref>they still fight</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| combatant2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as ip<ref>Probiball incident with EditsHorizon</ref>.
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
76c3d74f75cea619a97904958bbb0d5fa71cc5d6
263
262
2023-11-28T11:46:05Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
* Many treaties but none really going as planned<ref>they still fight</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| combatant2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as ip<ref>Probiball incident with EditsHorizon</ref>.
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
d22f56ff9f3eb00b9cc71491d97b77db49478131
264
263
2023-11-28T11:46:47Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
* Many treaties but none really going as planned<ref>they still fight</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| combatant2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 313 members<ref>As of November 2023</ref>
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as ip<ref>Probiball incident with EditsHorizon</ref>.
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
56126c7e5888d5a4697ca5c1bca8b3f3cb498317
272
264
2023-11-28T17:26:13Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
* Many treaties but none really going as planned<ref>they still fight</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 313 members<ref>As of November 2023</ref>
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as ip<ref>Probiball incident with EditsHorizon</ref>.
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
90a9b0da0daf41c90f173893a20507d937e84860
273
272
2023-11-28T17:28:02Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
* Many treaties but none really going as planned<ref>they still fight</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] PYSEC
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 313 members<ref>As of November 2023</ref>
| strength2 = 600+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as ip<ref>Probiball incident with EditsHorizon</ref>.
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
3731393ee2bedc2d08cf6b68cb4bd58c6e286ca3
274
273
2023-11-28T17:28:24Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
* Many treaties but none really going as planned<ref>they still fight</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] PYSEC
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 313 members<ref>As of November 2023</ref>
| strength2 = 700+ members
| strength3 =
| casualties1 = Many members leaving
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as ip<ref>Probiball incident with EditsHorizon</ref>.
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
07d1a7199167a0ce70ae2e3a88b4c5df13777b7c
275
274
2023-11-28T17:28:58Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
* Many treaties but none really going as planned<ref>they still fight</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] PYSEC
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 313 members<ref>As of November 2023</ref>
| strength2 = 700+ members
| strength3 =
| casualties1 = 105 members left
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as ip<ref>Probiball incident with EditsHorizon</ref>.
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
ba114b0360df1a33c9549b3808618e984641b132
276
275
2023-11-28T17:29:24Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
* Many treaties but none really going as planned<ref>they still fight</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] PYSEC
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 313 members<ref>As of November 2023</ref>
| strength2 = 700+ members
| strength3 =
| casualties1 = 105 members left<ref>Since May, 2023</ref>
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as ip<ref>Probiball incident with EditsHorizon</ref>.
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
df92147f83686c8953030f318f85689c49943996
277
276
2023-11-28T17:30:02Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[Geotuber Conflict]]
| image =
| image_size =
| alt =
| caption =
| date = Since March 2023<ref>Most latest data i could find</ref>
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory = * Big wars and many members from both side leaving<ref>member count</ref>
* Many treaties but none really going as planned<ref>they still fight</ref>
| result =
| status = '''''Ongoing'''''
| combatants_header =
| combatant1 =
* [[file:PYSEC.jpg|30px]] PYSEC
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 313 members<ref>As of November 2023</ref>
| strength2 = 700+ members
| strength3 =
| casualties1 = 105 members left<ref>Since May, 2023</ref>
| casualties2 = Many members leaving
| casualties3 =
| notes =
| campaignbox =
}}
==Background==
One day, Umar Edits saw how Indians had a group called AWPT, so he decided to create a server for Pakistanis so that they can counter the Indians. Since AWPT is Indian, and Pysec is Pakistani, Indians and Pakistanis already have a huge rivalry between them, as well as their hatred towards each other was unstoppable, so because of this, both groups have gone to war to ultimately defeat each other, but due to this there has been many times when both parties leaked each other personal information, as well as IP<ref>Probiball incident with EditsHorizon</ref>
These wars have caused certain chaos and many treaties, but most of the treaties made by both aren't really going as it should go<ref>they still fight over mini things</ref>.
== Engagements ==
<!--
| align="center" style="background-color:#9BDF8B"|
| align="center" style="background-color:#91CBE7"|
| align="center" style="background-color:#bbbbbb"| Inconclusive or Disputed{{efn|Brief explanation of situation (if needed)}}
|color:#F0F481"| Ongoing
| align="center" style="background-
-->
{| class="wikitable sortable"
|-
! Name
! Location
! Start date
! End date
! Result<!-- any of the claims for victory by one side or the other should have explicit source citations, so they can be dated, and it is clear who is making the assessment. "Victory" claims should not be in Wikipedia voice without sources. -->
|-
| [[First Pysec-Awpt War]]
| Discord, Youtube
| 25 April
2023
| 1 May
2023
| align="center" style="background-color:#9BDF8B"| P.Y.S.E.C victory<ref>P.Y.S.E.C have achieved his goal to delete the youtube post.</ref>
|-
| [[End of TheGamingKing]]
| Youtube
| 10 March
2023
| 14 March
2023
| align="center" style="background-color:#91CBE7"| AWPT victory<ref>AWPT had succesfully terminated TheGamingKing</ref>
|-
|[[End of sAvAgE_oP]]
|Youtube
|24 September,
2023
|26 September
2023
| align="center" style="background-color:#9BDF8B"|P.Y.S.E.C victory<ref>savage_op had been succesfully terminated</ref>
|}
== See also ==
* [[Geotuber Ranking]]
== References ==
079caa0983266673f70173b6d1050a5417d0cbfe
End of TheGamingKing
0
116
265
239
2023-11-28T11:49:54Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image = Delete.png
| image_size =
| alt =
| caption = TGK channel no longer accesible
| date = March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT celebrates victory</ref><ref>AWPT plan has been succesfull</ref><ref>TheGamingKing Terminated on youtube</ref><ref>Many AWPT members strike TGK</ref>
| status =
| combatants_header =
| combatant1 =
* [[file:TGK.jpg|29px]] TGK
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
* [[file:TGK.jpg|28px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] AWPT Alliance
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = TGK Terminated<ref>upper referenes</ref>
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
Since start, AWPT had many plans to terminate TGK, but on any point of march, this plan was succesfull<ref>AWPT terminates TGK</ref>
==Background==
TGK created different videos responding to Indians, poking fun at their country and its friends. Indians didn't appreciate the jokes about their homeland and decided to oppose him, maybe even getting him kicked out to keep him away<ref>termination main point</ref>.
==Engagements==
* [[First Phrase Battle]]
* [[Second Phrase Battle]]
* [[THIRD Phrase Battle]]
==References==
5b85b0ce8d7230a4df4f2887522c6a777ad207ae
271
265
2023-11-28T17:22:29Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image = Delete.png
| image_size =
| alt =
| caption = TGK channel no longer accesible
| date = 10 March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT celebrates victory</ref><ref>AWPT plan has been succesfull</ref><ref>TheGamingKing Terminated on youtube</ref><ref>Many AWPT members strike TGK</ref>
| status =
| combatants_header =
| combatant1 =
* [[file:TGK.jpg|29px]] TGK
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
* [[file:TGK.jpg|28px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] AWPT Alliance
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = TGK Terminated<ref>upper referenes</ref>
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
Since start, AWPT had many plans to terminate TGK, but on any point of march, this plan was succesfull<ref>AWPT terminates TGK</ref>
==Background==
TGK created different videos responding to Indians, poking fun at their country and its friends. Indians didn't appreciate the jokes about their homeland and decided to oppose him, maybe even getting him kicked out to keep him away<ref>termination main point</ref>.
==Engagements==
* [[First Phrase Battle]]
* [[Second Phrase Battle]]
* [[THIRD Phrase Battle]]
==References==
c249ad077ef6e378314560e6934bc58dcfa983e2
279
271
2023-11-28T17:37:21Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image = Delete.png
| image_size =
| alt =
| caption = TGK channel no longer accesible
| date = 10 March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT celebrates victory</ref><ref>AWPT plan has been succesfull</ref><ref>TheGamingKing Terminated on youtube</ref><ref>Many AWPT members strike TGK</ref>
| status =
| combatants_header =
| combatant1 =
* [[file:TGK.jpg|29px]] TGK
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
* [[file:TGK.jpg|28px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] AWPT Alliance
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = TGK Terminated<ref>upper referenes</ref>
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
Since start, AWPT had many plans to terminate TGK, but on any point of march, this plan was succesfull<ref>AWPT terminates TGK</ref>
==Background==
TGK created different videos responding to Indians, poking fun at their country and its friends. Indians didn't appreciate the jokes about their homeland and decided to oppose him, maybe even getting him kicked out to keep him away<ref>termination main point</ref>.
==Engagements==
* [[First Phrase Battle]]
* [[Second Phrase Battle]]
* [[Final Phrase Battle]]
==References==
e64785fb0268dbb70277f2c8e0850e2e14956fcd
First Phrase Battle
0
120
266
2023-11-28T11:51:35Z
WikiA3ro
2
Created page with "{{Infobox military conflict | conflict = | width = | partof = [[PYSEC-AWPT Cold War]] | image = Delete.png | image_size = | alt = | caption = | date = March 2023 | place = Youtube | coordinates = <!--Use the {{coord}} template --> | map_type = | map_relief = | map_size = | map_marksize = | map_caption = | map_label = | territory = | result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT members manage..."
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image = Delete.png
| image_size =
| alt =
| caption =
| date = March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT members manage to strike TGK</ref>
| status =
| combatants_header =
| combatant1 =
* [[file:TGK.jpg|29px]] TGK
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
* [[file:TGK.jpg|28px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] AWPT Alliance
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = TGK Terminated<ref>upper referenes</ref>
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
f8db214ee2bbe9003456b3dce4ffb60cf57946b3
267
266
2023-11-28T11:51:54Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image = Delete.png
| image_size =
| alt =
| caption =
| date = March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT members manage to strike TGK</ref>
| status =
| combatants_header =
| combatant1 =
* [[file:TGK.jpg|29px]] TGK
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
* [[file:TGK.jpg|28px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] AWPT Alliance
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = TGK channel striked<ref>upper referenes</ref>
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
25298b0a7b3f3891983a34a2fe0384cda507880f
269
267
2023-11-28T17:21:13Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image = Delete.png
| image_size =
| alt =
| caption =
| date = March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT members manage to strike TGK</ref>
| status =
| combatants_header =
| combatant1 =
* [[file:TGK.jpg|29px]] TGK
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
* [[file:TGK.jpg|28px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] AWPT Alliance
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = TGK channel striked<ref>upper referenes</ref>
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
'' ''' for further understanding, read [[End of TheGamingKing]] '''''
54aa39171d8c47953598be52adfb787e8e895d0f
270
269
2023-11-28T17:21:39Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image = Delete.png
| image_size =
| alt =
| caption =
| date = March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT members manage to strike TGK</ref>
| status =
| combatants_header =
| combatant1 =
* [[file:TGK.jpg|29px]] TGK
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
* [[file:TGK.jpg|28px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] AWPT Alliance
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members
| strength2 = 600+ members
| strength3 =
| casualties1 = TGK channel striked<ref>upper referenes</ref>
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
'' ''' for further understanding, read [[End of TheGamingKing]] '''''
==References==
43855b070f76c911e35c12769262f956736fe0da
Operation TRL
0
112
268
247
2023-11-28T17:19:03Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image =
| image_size =
| alt =
| caption =
| date = 25 April 2023
| place = Discord, Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:PYSEC.jpg|25px]] P.Y.S.E.C victory<ref>Pysec leaks EditzHorizon's information</ref><ref>as well as his houses</ref>
| status =
| combatants_header =
| combatant1 = [[file:PYSEC.jpg|30px]] Pysec
| combatant2 = [[file:AWPT.jpg|28px]] AWPT
| combatant3 =
| commander1 =
* [[file:PYSEC.jpg|30px]] UmarEdits
* [[file:PYSEC.jpg|30px]] Probiball
* [[file:PYSEC.jpg|30px]] Abdullahdoitall
* [[file:PYSEC.jpg|30px]] MapManiac
| commander2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] sAvAgE_oP
* [[file:AWPT.jpg|28px]] Editz_Horizon
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 147+ members<ref>as of april</ref>
| strength2 = 600+ members<ref>as of april</ref>
| strength3 =
| casualties1 = None
| casualties2 = 1 surrender<ref>PYSEC claims</ref>
| casualties3 =
| notes =
| campaignbox =
}}
'''''for further understanding, read [[First Pysec-Awpt War]]'''''
==References==
1194dba5776f983265ed15a3e8279c356c42bf07
Second Phrase Battle
0
121
278
2023-11-28T17:36:24Z
WikiA3ro
2
Created page with "{{Infobox military conflict | conflict = | width = | partof = [[End of TheGamingKing]] | image = Delete.png | image_size = | alt = | caption = | date = March 2023 | place = Youtube | coordinates = <!--Use the {{coord}} template --> | map_type = | map_relief = | map_size = | map_marksize = | map_caption = | map_label = | territory = | result = [[file:AWPT.jpg|28px]] AWPT strategy failure<ref>In Break..."
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[End of TheGamingKing]]
| image = Delete.png
| image_size =
| alt =
| caption =
| date = March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT strategy failure<ref>In Break</ref><ref>In Break</ref><ref>In Break</ref>
| status =
| combatants_header =
| combatant1 =
| combatant2 =
| combatant3 =
| commander1 =
* [[file:TGK.jpg|30px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] Acedvin
* [[file:AWPT.jpg|28px]] AWPT members
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members<ref>data when around this war</ref>
| strength2 = 600+ members<ref>Upper reference</ref>
| strength3 =
| casualties1 = None
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
'''''for further details read [[End of TheGamingKing]]'''''
==References ==
87699917d62abec5fe4eda2692a945fb8008a440
Final Phrase Battle
0
122
280
2023-11-28T17:39:00Z
WikiA3ro
2
Created page with "{{Infobox military conflict | conflict = | width = | partof = [[PYSEC-AWPT Cold War]] | image = Delete.png | image_size = | alt = | caption = TGK channel no longer accesible | date = 10 March 2023 | place = Youtube | coordinates = <!--Use the {{coord}} template --> | map_type = | map_relief = | map_size = | map_marksize = | map_caption = | map_label = | territory = | result = [[file:AWPT.jpg|28px]] A..."
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image = Delete.png
| image_size =
| alt =
| caption = TGK channel no longer accesible
| date = 10 March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT celebrates victory</ref><ref>AWPT plan has been succesfull</ref><ref>TheGamingKing Terminated on youtube</ref><ref>Many AWPT members strike TGK</ref>
| status =
| combatants_header =
| combatant1 =
* [[file:TGK.jpg|29px]] TGK
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
* [[file:TGK.jpg|28px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] AWPT Alliance
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members<ref>March data</ref>
| strength2 = 600+ members<ref>March data</ref>
| strength3 =
| casualties1 = TGK Terminated<ref>upper referenes</ref>
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
''''' for further information, please check out [[End of TheGamingKing]] '''''
909c0eb3c8c18e84851eb364f146de6335b38c31
281
280
2023-11-28T17:39:09Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image = Delete.png
| image_size =
| alt =
| caption = TGK channel no longer accesible
| date = 10 March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT celebrates victory</ref><ref>AWPT plan has been succesfull</ref><ref>TheGamingKing Terminated on youtube</ref><ref>Many AWPT members strike TGK</ref>
| status =
| combatants_header =
| combatant1 =
* [[file:TGK.jpg|29px]] TGK
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
* [[file:TGK.jpg|28px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] AWPT Alliance
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members<ref>March data</ref>
| strength2 = 600+ members<ref>March data</ref>
| strength3 =
| casualties1 = TGK Terminated<ref>upper referenes</ref>
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
''''' for further information, please check out [[End of TheGamingKing]] '''''
==References ==
ff673a03bec0d81149e2b592bad1b2f345f94e0b
282
281
2023-11-28T17:39:37Z
WikiA3ro
2
wikitext
text/x-wiki
{{Infobox military conflict
| conflict =
| width =
| partof = [[PYSEC-AWPT Cold War]]
| image = Delete.png
| image_size =
| alt =
| caption = TGK channel no longer accesible
| date = 14 March 2023
| place = Youtube
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result = [[file:AWPT.jpg|28px]] AWPT victory<ref>AWPT celebrates victory</ref><ref>AWPT plan has been succesfull</ref><ref>TheGamingKing Terminated on youtube</ref><ref>Many AWPT members strike TGK</ref>
| status =
| combatants_header =
| combatant1 =
* [[file:TGK.jpg|29px]] TGK
| combatant2 =
* [[file:AWPT.jpg|28px]] AWPT Team
| combatant3 =
| commander1 =
* [[file:TGK.jpg|28px]] TGK
* [[file:PYSEC.jpg|30px]] PYSEC
| commander2 =
* [[file:AWPT.jpg|28px]] AWPT Alliance
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 = 148+ members<ref>March data</ref>
| strength2 = 600+ members<ref>March data</ref>
| strength3 =
| casualties1 = TGK Terminated<ref>upper referenes</ref>
| casualties2 = None
| casualties3 =
| notes =
| campaignbox =
}}
''''' for further information, please check out [[End of TheGamingKing]] '''''
==References ==
febaf1c3e3b32e00e4694fa9add1496adb432997